| Index: pkg/compiler/lib/src/compile_time_constants.dart
|
| diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
|
| index a1048438ff4a8be257113c3149e1f8d0580f669d..11d56c963208cbab4ea692f841cc3e200f90de45 100644
|
| --- a/pkg/compiler/lib/src/compile_time_constants.dart
|
| +++ b/pkg/compiler/lib/src/compile_time_constants.dart
|
| @@ -162,7 +162,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
|
| value = null;
|
| }
|
| } else {
|
| - DartType constantType = value.value.computeType(compiler);
|
| + DartType constantType = value.value.getType(compiler.coreTypes);
|
| if (!constantSystem.isSubtype(compiler,
|
| constantType, elementType)) {
|
| if (isConst) {
|
| @@ -485,10 +485,12 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| message: MessageKind.DEFERRED_COMPILE_TIME_CONSTANT);
|
| }
|
| if (Elements.isStaticOrTopLevelFunction(element)) {
|
| + FunctionElementX function = element;
|
| + function.computeType(compiler);
|
| return new AstConstant(
|
| context, send, new FunctionConstantExpression(
|
| - new FunctionConstantValue(element),
|
| - element));
|
| + new FunctionConstantValue(function),
|
| + function));
|
| } else if (Elements.isStaticOrTopLevelField(element)) {
|
| ConstantExpression result;
|
| if (element.isConst) {
|
| @@ -601,7 +603,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| if (condition == null) {
|
| return null;
|
| } else if (!condition.value.isBool) {
|
| - DartType conditionType = condition.value.computeType(compiler);
|
| + DartType conditionType = condition.value.getType(compiler.coreTypes);
|
| if (isEvaluatingConstant) {
|
| compiler.reportFatalError(
|
| node.condition, MessageKind.NOT_ASSIGNABLE,
|
| @@ -732,7 +734,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
| }
|
|
|
| if (!firstArgument.isString) {
|
| - DartType type = defaultValue.computeType(compiler);
|
| + DartType type = defaultValue.getType(compiler.coreTypes);
|
| compiler.reportFatalError(
|
| send.arguments.head, MessageKind.NOT_ASSIGNABLE,
|
| {'fromType': type, 'toType': compiler.stringClass.rawType});
|
| @@ -741,7 +743,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
|
|
| if (constructor == compiler.intEnvironment &&
|
| !(defaultValue.isNull || defaultValue.isInt)) {
|
| - DartType type = defaultValue.computeType(compiler);
|
| + DartType type = defaultValue.getType(compiler.coreTypes);
|
| compiler.reportFatalError(
|
| send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
|
| {'fromType': type, 'toType': compiler.intClass.rawType});
|
| @@ -750,7 +752,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
|
|
| if (constructor == compiler.boolEnvironment &&
|
| !(defaultValue.isNull || defaultValue.isBool)) {
|
| - DartType type = defaultValue.computeType(compiler);
|
| + DartType type = defaultValue.getType(compiler.coreTypes);
|
| compiler.reportFatalError(
|
| send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
|
| {'fromType': type, 'toType': compiler.boolClass.rawType});
|
| @@ -759,7 +761,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
|
|
|
| if (constructor == compiler.stringEnvironment &&
|
| !(defaultValue.isNull || defaultValue.isString)) {
|
| - DartType type = defaultValue.computeType(compiler);
|
| + DartType type = defaultValue.getType(compiler.coreTypes);
|
| compiler.reportFatalError(
|
| send.arguments.tail.head, MessageKind.NOT_ASSIGNABLE,
|
| {'fromType': type, 'toType': compiler.stringClass.rawType});
|
| @@ -907,7 +909,7 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
|
| AstConstant constant) {
|
| if (compiler.enableTypeAssertions) {
|
| DartType elementType = element.type.substByContext(constructedType);
|
| - DartType constantType = constant.value.computeType(compiler);
|
| + DartType constantType = constant.value.getType(compiler.coreTypes);
|
| if (!constantSystem.isSubtype(compiler, constantType, elementType)) {
|
| compiler.withCurrentElement(constant.element, () {
|
| compiler.reportFatalError(
|
|
|