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 9a52c3ec1154f6b0ca83ba5f8ddbca372869ec7c..0eae100e16965ba51a8319f337e922c3fea1c520 100644 |
--- a/pkg/compiler/lib/src/compile_time_constants.dart |
+++ b/pkg/compiler/lib/src/compile_time_constants.dart |
@@ -189,9 +189,13 @@ abstract class ConstantCompilerBase implements ConstantCompiler { |
return result; |
} |
if (element.hasConstant) { |
- if (element.constant != null && |
- compiler.serialization.supportsDeserialization) { |
- evaluate(element.constant); |
+ if (element.constant != null) { |
+ if (compiler.serialization.supportsDeserialization) { |
+ evaluate(element.constant); |
+ } |
+ assert(invariant(element, hasConstantValue(element.constant), |
+ message: "Constant expression has not been evaluated: " |
+ "${element.constant.toStructuredText()}.")); |
} |
return element.constant; |
} |
@@ -592,7 +596,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> { |
if (send.isPropertyAccess) { |
AstConstant result; |
if (Elements.isStaticOrTopLevelFunction(element)) { |
- FunctionElementX function = element; |
+ FunctionElement function = element; |
function.computeType(resolution); |
result = new AstConstant( |
context, |