| 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;
|
|
|