Chromium Code Reviews| Index: sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| diff --git a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| index b53316feecc2636131146928b347db145baaafb3..fb691c23e78f1c6c5c6b82c2bbe7c0006370d65a 100644 |
| --- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| +++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
| @@ -1730,11 +1730,10 @@ abstract class BaseClassElementX extends ElementX implements ClassElement { |
| bool get isUnnamedMixinApplication => false; |
| - // TODO(johnniwinther): Add [thisType] getter similar to [rawType]. |
| - InterfaceType computeType(Compiler compiler) { |
| + void computeThisAndRawType(Compiler compiler, Link<DartType> typeVariables) { |
| if (thisType == null) { |
| if (origin == null) { |
| - Link<DartType> parameters = computeTypeParameters(compiler); |
| + Link<DartType> parameters = typeVariables; |
| thisType = new InterfaceType(this, parameters); |
| if (parameters.isEmpty) { |
| rawTypeCache = thisType; |
| @@ -1751,6 +1750,13 @@ abstract class BaseClassElementX extends ElementX implements ClassElement { |
| rawTypeCache = origin.rawType; |
| } |
| } |
| + } |
| + |
| + // TODO(johnniwinther): Add [thisType] getter similar to [rawType]. |
| + InterfaceType computeType(Compiler compiler) { |
| + if (thisType == null) { |
| + computeThisAndRawType(compiler, computeTypeParameters(compiler)); |
| + } |
| return thisType; |
| } |
| @@ -2256,7 +2262,8 @@ class MixinApplicationElementX extends BaseClassElementX |
| Link<DartType> computeTypeParameters(Compiler compiler) { |
| NamedMixinApplication named = node.asNamedMixinApplication(); |
| - if (named == null) return const Link<DartType>(); |
| + assert(invariant(this, named != null, |
|
ahe
2013/11/28 15:28:26
I'd really prefer if we didn't add redundant asser
Johnni Winther
2013/12/03 15:57:38
Done.
|
| + message: "computeTypeParameters called for unnamed mixin application")); |
| return TypeDeclarationElementX.createTypeVariables( |
| this, named.typeParameters); |
| } |
| @@ -2331,7 +2338,7 @@ class TypeVariableElementX extends ElementX implements TypeVariableElement { |
| TypeVariableType type; |
| DartType bound; |
| - TypeVariableElementX(name, Element enclosing, this.cachedNode, |
| + TypeVariableElementX(String name, Element enclosing, this.cachedNode, |
| [this.type, this.bound]) |
| : super(name, ElementKind.TYPE_VARIABLE, enclosing); |