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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java

Issue 10829365: Issue 4553. Any constant is valid for 'case'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java
index 96df0a2d78c182ecadb8482a661a59fbb4df839f..e837b426a8b4e5e8ef00ebbdab4987de4ff48a65 100644
--- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java
@@ -7,6 +7,7 @@ package com.google.dart.compiler.resolver;
import com.google.common.annotations.VisibleForTesting;
import com.google.dart.compiler.DartCompilerContext;
import com.google.dart.compiler.ast.DartBlock;
+import com.google.dart.compiler.ast.DartCase;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartExpression;
import com.google.dart.compiler.ast.DartField;
@@ -210,6 +211,12 @@ public class CompileTimeConstantResolver {
}
return null;
}
+
+ @Override
+ public Element visitCase(DartCase node) {
+ resolveConstantExpression(node.getExpr());
+ return super.visitCase(node);
+ }
@Override
public Element visitNewExpression(DartNewExpression node) {

Powered by Google App Engine
This is Rietveld 408576698