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

Unified Diff: pkg/compiler/lib/src/resolution/members.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/patch_parser.dart ('k') | pkg/compiler/lib/src/resolution/resolution_common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/resolution/members.dart
diff --git a/pkg/compiler/lib/src/resolution/members.dart b/pkg/compiler/lib/src/resolution/members.dart
index 8d05b1138e8570aa9bee1b573a1d63282d8c8f2e..6069d4cebddd98b67bb58ae935ed13eebc690f1b 100644
--- a/pkg/compiler/lib/src/resolution/members.dart
+++ b/pkg/compiler/lib/src/resolution/members.dart
@@ -1969,7 +1969,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
ConstantExpression constant =
compiler.resolver.constantCompiler.compileNode(
argumentNode, registry.mapping);
- ConstantValue name = constant.value;
+ ConstantValue name = compiler.constants.getConstantValue(constant);
if (!name.isString) {
DartType type = name.getType(compiler.coreTypes);
compiler.reportError(argumentNode, MessageKind.STRING_EXPECTED,
@@ -2027,7 +2027,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
return;
}
- ConstantValue value = constant.value;
+ ConstantValue value = compiler.constants.getConstantValue(constant);
if (value.isMap) {
checkConstMapKeysDontOverrideEquals(node, value);
}
@@ -2432,7 +2432,8 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
assert(invariant(node, constant != null,
message: 'No constant computed for $node'));
- DartType caseType = typeOfConstant(constant.value);
+ ConstantValue value = compiler.constants.getConstantValue(constant);
+ DartType caseType = typeOfConstant(value);
if (firstCaseType == null) {
firstCase = caseMatch;
@@ -2447,7 +2448,7 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
} else if (caseType.element == compiler.functionClass) {
compiler.reportError(node, MessageKind.SWITCH_CASE_FORBIDDEN,
{'type': "Function"});
- } else if (constant.value.isObject && overridesEquals(caseType)) {
+ } else if (value.isObject && overridesEquals(caseType)) {
compiler.reportError(firstCase.expression,
MessageKind.SWITCH_CASE_VALUE_OVERRIDES_EQUALS,
{'type': caseType});
« no previous file with comments | « pkg/compiler/lib/src/patch_parser.dart ('k') | pkg/compiler/lib/src/resolution/resolution_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698