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 8e9bf312151ad629658b80ebcdb76d50a272ddfa..e16dc788c5ad5834e614d76fdf941181e2ae0c6e 100644 |
--- a/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
+++ b/sdk/lib/_internal/compiler/implementation/elements/modelx.dart |
@@ -1364,7 +1364,7 @@ abstract class BaseClassElementX extends ElementX implements ClassElement { |
* |
* This type is computed together with [thisType] in [computeType]. |
*/ |
- InterfaceType rawType; |
+ InterfaceType rawTypeCache; |
DartType supertype; |
DartType defaultClass; |
Link<DartType> interfaces; |
@@ -1400,23 +1400,29 @@ abstract class BaseClassElementX extends ElementX implements ClassElement { |
Link<DartType> parameters = computeTypeParameters(compiler); |
thisType = new InterfaceType(this, parameters); |
if (parameters.isEmpty) { |
- rawType = thisType; |
+ rawTypeCache = thisType; |
} else { |
var dynamicParameters = const Link<DartType>(); |
parameters.forEach((_) { |
dynamicParameters = |
dynamicParameters.prepend(compiler.types.dynamicType); |
}); |
- rawType = new InterfaceType(this, dynamicParameters); |
+ rawTypeCache = new InterfaceType(this, dynamicParameters); |
} |
} else { |
thisType = origin.computeType(compiler); |
- rawType = origin.rawType; |
+ rawTypeCache = origin.rawType; |
} |
} |
return thisType; |
} |
+ InterfaceType get rawType { |
+ assert(invariant(this, rawTypeCache != null, |
+ message: 'Raw type has not been computed for $this')); |
+ return rawTypeCache; |
+ } |
+ |
Link<DartType> computeTypeParameters(Compiler compiler); |
/** |