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

Unified Diff: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.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
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
index 6418eb1c473ca59db7c5992ac21ff4e7478134f1..6df713b74c9f6612158af2557447966e539365f9 100644
--- a/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
+++ b/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java
@@ -14,6 +14,7 @@ import com.google.dart.compiler.ast.ASTVisitor;
import com.google.dart.compiler.ast.DartArrayLiteral;
import com.google.dart.compiler.ast.DartBinaryExpression;
import com.google.dart.compiler.ast.DartBooleanLiteral;
+import com.google.dart.compiler.ast.DartCase;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartDeclaration;
import com.google.dart.compiler.ast.DartDoubleLiteral;
@@ -681,6 +682,12 @@ public class CompileTimeConstantAnalyzer {
}
return super.visitInitializer(node);
}
+
+ @Override
+ public Void visitCase(DartCase node) {
+ checkConstantExpression(node.getExpr());
+ return super.visitCase(node);
+ }
@Override
public Void visitMapLiteral(DartMapLiteral node) {
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698