Index: pkg/compiler/lib/src/resolution/resolution.dart |
diff --git a/pkg/compiler/lib/src/resolution/resolution.dart b/pkg/compiler/lib/src/resolution/resolution.dart |
index 05e1cf08270a8adf530cfb01eb1b98806ccbd360..f77519078554fdd3435b4a9270104b57fe86c583 100644 |
--- a/pkg/compiler/lib/src/resolution/resolution.dart |
+++ b/pkg/compiler/lib/src/resolution/resolution.dart |
@@ -53,6 +53,7 @@ import 'class_members.dart' show MembersCreator; |
import 'constructors.dart'; |
import 'members.dart'; |
import 'registry.dart'; |
+import 'resolution_result.dart'; |
import 'scope.dart' show MutableScope; |
import 'signatures.dart'; |
import 'tree_elements.dart'; |
@@ -387,7 +388,10 @@ class ResolverTask extends CompilerTask { |
if (initializer != null) { |
// TODO(johnniwinther): Avoid analyzing initializers if |
// [Compiler.analyzeSignaturesOnly] is set. |
- visitor.visit(initializer); |
+ ResolutionResult result = visitor.visit(initializer); |
+ if (result.isConstant) { |
+ element.constant = result.constant; |
+ } |
} else if (modifiers.isConst) { |
reporter.reportErrorMessage( |
element, MessageKind.CONST_WITHOUT_INITIALIZER); |