Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(962)

Unified Diff: pkg/compiler/lib/src/serialization/modelz.dart

Issue 2000663002: Handle resolvedAst for forwarding constructors and callType on unnamed mixin applications. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Fix test. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/serialization/task.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/modelz.dart
diff --git a/pkg/compiler/lib/src/serialization/modelz.dart b/pkg/compiler/lib/src/serialization/modelz.dart
index f721eb17d400258bff929f4cc35f82eb832f9cb1..75bdbf357ac7c51f4b718f5c8aa02c89706cb7f3 100644
--- a/pkg/compiler/lib/src/serialization/modelz.dart
+++ b/pkg/compiler/lib/src/serialization/modelz.dart
@@ -10,6 +10,7 @@
library dart2js.serialization.modelz;
import '../common.dart';
+import '../common/names.dart';
import '../common/resolution.dart' show Resolution;
import '../constants/constructors.dart';
import '../constants/expressions.dart';
@@ -772,7 +773,10 @@ abstract class FunctionTypedElementMixin
List<DartType> get typeVariables => functionSignature.typeVariables;
}
-abstract class ClassElementMixin implements ElementZ, ClassElement {
+abstract class ClassElementMixin
+ implements ElementZ, ClassElement, class_members.ClassMemberMixin {
+ bool _isResolved = false;
+
InterfaceType _createType(List<DartType> typeArguments) {
return new InterfaceType(this, typeArguments);
}
@@ -806,7 +810,12 @@ abstract class ClassElementMixin implements ElementZ, ClassElement {
@override
void ensureResolved(Resolution resolution) {
- resolution.registerClass(this);
+ if (!_isResolved) {
+ _isResolved = true;
+ class_members.MembersCreator
+ .computeClassMembersByName(resolution, this, Identifiers.call);
+ resolution.registerClass(this);
+ }
}
}
@@ -903,6 +912,7 @@ class ClassElementZ extends DeserializedElementZ
@override
FunctionType get callType {
_ensureSuperHierarchy();
+ // TODO(johnniwinther): Why can't this always be computed in ensureResolved?
return _callType;
}
}
@@ -967,8 +977,11 @@ class UnnamedMixinApplicationElementZ extends ElementZ
for (ConstructorElement definingConstructor in superclass.constructors) {
if (definingConstructor.isGenerativeConstructor &&
definingConstructor.memberName.isAccessibleFrom(library)) {
- builder.addLast(
- new ForwardingConstructorElementZ(this, definingConstructor));
+ ForwardingConstructorElementZ constructor =
+ new ForwardingConstructorElementZ(this, definingConstructor);
+ constructor.resolvedAst = new SynthesizedResolvedAst(
+ constructor, ResolvedAstKind.FORWARDING_CONSTRUCTOR);
+ builder.addLast(constructor);
}
}
_constructors = builder.toLink();
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution.dart ('k') | pkg/compiler/lib/src/serialization/task.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698