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

Unified Diff: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart

Issue 12079094: Take type arguments into account in interface type subtype check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 7 years, 10 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 | « no previous file | sdk/lib/_internal/compiler/implementation/dart_types.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
index 691cbac7af90626a3cefc568083922309a361414..e4758a2ec1b2fc4e36c6f617a616034e3792395c 100644
--- a/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
+++ b/sdk/lib/_internal/compiler/implementation/compile_time_constants.dart
@@ -175,7 +175,7 @@ class ConstantHandler extends CompilerTask {
if (isConst) {
compiler.reportError(node, new CompileTimeConstantError(
MessageKind.NOT_ASSIGNABLE,
- {'fromType': elementType, 'toType': constantType}));
+ {'fromType': constantType, 'toType': elementType}));
} else {
// If the field can be lazily initialized, we will throw
// the exception at runtime.
@@ -337,7 +337,8 @@ class CompileTimeConstantEvaluator extends Visitor {
arguments.add(evaluateConstant(link.head));
}
// TODO(floitsch): get type parameters.
- DartType type = new InterfaceType(compiler.listClass);
+ compiler.listClass.computeType(compiler);
+ DartType type = compiler.listClass.rawType;
Constant constant = new ListConstant(type, arguments);
handler.registerCompileTimeConstant(constant);
return constant;
@@ -373,7 +374,8 @@ class CompileTimeConstantEvaluator extends Visitor {
}
bool hasProtoKey = (protoValue != null);
// TODO(floitsch): this should be a List<String> type.
- DartType keysType = new InterfaceType(compiler.listClass);
+ compiler.listClass.computeType(compiler);
+ DartType keysType = compiler.listClass.rawType;
ListConstant keysList = new ListConstant(keysType, keys);
handler.registerCompileTimeConstant(keysList);
SourceString className = hasProtoKey
@@ -382,7 +384,7 @@ class CompileTimeConstantEvaluator extends Visitor {
ClassElement classElement = compiler.jsHelperLibrary.find(className);
classElement.ensureResolved(compiler);
// TODO(floitsch): copy over the generic type.
- DartType type = new InterfaceType(classElement);
+ DartType type = classElement.rawType;
handler.registerInstantiatedClass(classElement);
Constant constant = new MapConstant(type, keysList, values, protoValue);
handler.registerCompileTimeConstant(constant);
@@ -660,7 +662,8 @@ class CompileTimeConstantEvaluator extends Visitor {
handler.registerInstantiatedClass(classElement);
// TODO(floitsch): take generic types into account.
- DartType type = classElement.computeType(compiler);
+ classElement.computeType(compiler);
+ DartType type = classElement.rawType;
Constant constant = new ConstructedConstant(type, jsNewArguments);
handler.registerCompileTimeConstant(constant);
return constant;
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/dart_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698