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

Unified Diff: pkg/compiler/lib/src/typechecker.dart

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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 | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/serialization_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/typechecker.dart
diff --git a/pkg/compiler/lib/src/typechecker.dart b/pkg/compiler/lib/src/typechecker.dart
index e186ee468711f781d11c2514f45f5d59ef6a8c7f..ea010299a6274570895bb558c12b60dc2642de3f 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -1953,8 +1953,10 @@ class TypeCheckerVisitor extends Visitor<DartType> {
List<FieldElement> unreferencedFields = <FieldElement>[];
EnumClassElement enumClass = expressionType.element;
enumClass.enumValues.forEach((EnumConstantElement field) {
- ConstantValue constantValue =
- compiler.constants.getConstantValueForVariable(field);
+ // TODO(johnniwinther): Ensure that the enum constant is computed at
+ // this point.
+ ConstantValue constantValue = compiler.resolver.constantCompiler
+ .getConstantValueForVariable(field);
if (constantValue == null) {
// The field might not have been resolved.
unreferencedFields.add(field);
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | tests/compiler/dart2js/serialization_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698