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

Unified Diff: sdk/lib/_internal/compiler/implementation/elements/modelx.dart

Issue 13467021: Register type for literal list/map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
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);
/**

Powered by Google App Engine
This is Rietveld 408576698