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

Unified Diff: pkg/compiler/lib/src/inferrer/simple_types_inferrer.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/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
diff --git a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
index 6012f86b96fc424767a7eca10bd4dbcb6eef4305..59372ca77ff9d2472237078b085a1247d12ebb86 100644
--- a/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
+++ b/pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart
@@ -5,6 +5,7 @@
library simple_types_inferrer;
import '../closure.dart' show ClosureClassMap, ClosureScope;
+import '../constants/values.dart' show ConstantValue, IntConstantValue;
import '../cps_ir/cps_ir_nodes.dart' as cps_ir show Node;
import '../dart_types.dart'
show DartType, InterfaceType, FunctionType, TypeKind;
@@ -1474,10 +1475,11 @@ class SimpleTypeInferrerVisitor<T>
&& element.isField
&& Elements.isStaticOrTopLevelField(element)
&& compiler.world.fieldNeverChanges(element)) {
- var constant =
- compiler.backend.constants.getConstantForVariable(element);
- if (constant != null && constant.value.isInt) {
- return constant.value.primitiveValue;
+ ConstantValue value =
+ compiler.backend.constants.getConstantValueForVariable(element);
+ if (value != null && value.isInt) {
+ IntConstantValue intValue = value;
+ return intValue.primitiveValue;
}
}
return null;
« no previous file with comments | « pkg/compiler/lib/src/deferred_load.dart ('k') | pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698