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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 1917203002: Remove more type casts (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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
Index: pkg/analyzer/lib/src/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index ee59dd66bca58e2a31e122da00f235e1f5638b9c..a87c085386de557a0b5d861bd7726f0006ea8e2c 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -2316,10 +2316,11 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
for (MapLiteralEntry entry in node.entries) {
Object key = entry.key.accept(this);
Object value = entry.value.accept(this);
- if (key is! String || identical(value, NOT_A_CONSTANT)) {
+ if (key is String && !identical(value, NOT_A_CONSTANT)) {
+ map[(key as String)] = value;
+ } else {
return NOT_A_CONSTANT;
}
- map[(key as String)] = value;
}
return map;
}

Powered by Google App Engine
This is Rietveld 408576698