Chromium Code Reviews| Index: pkg/compiler/lib/src/elements/modelx.dart |
| diff --git a/pkg/compiler/lib/src/elements/modelx.dart b/pkg/compiler/lib/src/elements/modelx.dart |
| index 68ee1a47a71510e0749c8e2612acc893e6697db6..e963f0ad0aaf31a717b29a7dbfa1001857d6e6fc 100644 |
| --- a/pkg/compiler/lib/src/elements/modelx.dart |
| +++ b/pkg/compiler/lib/src/elements/modelx.dart |
| @@ -2044,17 +2044,24 @@ class SynthesizedConstructorElementX extends ConstructorElementX { |
| final ConstructorElement definingConstructor; |
| final bool isDefaultConstructor; |
| - SynthesizedConstructorElementX(String name, |
| + SynthesizedConstructorElementX.notForDefault(String name, |
| this.definingConstructor, |
|
Johnni Winther
2015/04/10 13:37:16
Bad indent.
sigurdm
2015/04/13 07:35:17
Done.
|
| - Element enclosing, |
| - this.isDefaultConstructor) |
| - : super(name, |
| + Element enclosing) |
| + : isDefaultConstructor = false, |
| + super(name, |
| ElementKind.GENERATIVE_CONSTRUCTOR, |
| Modifiers.EMPTY, |
| - enclosing); |
| + enclosing) ; |
| - SynthesizedConstructorElementX.forDefault(superMember, Element enclosing) |
| - : this('', superMember, enclosing, true); |
| + SynthesizedConstructorElementX.forDefault(this.definingConstructor, |
| + Element enclosing) |
| + : isDefaultConstructor = true, |
| + super('', |
| + ElementKind.GENERATIVE_CONSTRUCTOR, |
| + Modifiers.EMPTY, |
| + enclosing) { |
| + typeCache = new FunctionType.synthesized(enclosingClass.thisType); |
| + } |
| FunctionExpression parseNode(DiagnosticListener listener) => null; |
| @@ -2066,11 +2073,21 @@ class SynthesizedConstructorElementX extends ConstructorElementX { |
| bool get isSynthesized => true; |
| + DartType get type { |
| + if (isDefaultConstructor) { |
| + return super.type; |
| + } else { |
| + // TODO(johnniwinther): Ensure that the function type substitutes type |
| + // variables correctly. |
| + return definingConstructor.type; |
| + } |
| + } |
| + |
| FunctionSignature computeSignature(compiler) { |
| if (functionSignatureCache != null) return functionSignatureCache; |
| if (isDefaultConstructor) { |
| return functionSignatureCache = new FunctionSignatureX( |
| - type: new FunctionType(this, enclosingClass.thisType)); |
| + type: type); |
| } |
| if (definingConstructor.isErroneous) { |
| return functionSignatureCache = |