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

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

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 years, 7 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/tree_ir/tree_ir_nodes.dart ('k') | pkg/compiler/lib/src/use_unused_api.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 4811e3f7424f6deb1b881c76fdd39d621980a18f..85d82b3992980f12478d4e723b7a641b752b3bab 100644
--- a/pkg/compiler/lib/src/typechecker.dart
+++ b/pkg/compiler/lib/src/typechecker.dart
@@ -1807,13 +1807,13 @@ class TypeCheckerVisitor extends Visitor<DartType> {
List<FieldElement> unreferencedFields = <FieldElement>[];
EnumClassElement enumClass = expressionType.element;
enumClass.enumValues.forEach((FieldElement field) {
- ConstantExpression constantExpression =
- compiler.constants.getConstantForVariable(field);
- if (constantExpression == null) {
+ ConstantValue constantValue =
+ compiler.constants.getConstantValueForVariable(field);
+ if (constantValue == null) {
// The field might not have been resolved.
unreferencedFields.add(field);
} else {
- enumValues[constantExpression.value] = field;
+ enumValues[constantValue] = field;
}
});
@@ -1824,7 +1824,8 @@ class TypeCheckerVisitor extends Visitor<DartType> {
ConstantExpression caseConstant =
compiler.resolver.constantCompiler.compileNode(
caseMatch.expression, elements);
- enumValues.remove(caseConstant.value);
+ enumValues.remove(
+ compiler.constants.getConstantValue(caseConstant));
}
}
}
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_nodes.dart ('k') | pkg/compiler/lib/src/use_unused_api.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698