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

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

Issue 11793004: Switch 'default' is allowed to have fall-through (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.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/Resolver.java
diff --git a/compiler/java/com/google/dart/compiler/resolver/Resolver.java b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
index 28b7b86531067fcfb3f69b603aad982f164ae81c..6a9c2b352558b975891781db5ab9ef569b0ce876 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -19,6 +19,7 @@ import com.google.dart.compiler.ast.DartBinaryExpression;
import com.google.dart.compiler.ast.DartBlock;
import com.google.dart.compiler.ast.DartBooleanLiteral;
import com.google.dart.compiler.ast.DartBreakStatement;
+import com.google.dart.compiler.ast.DartCase;
import com.google.dart.compiler.ast.DartCatchBlock;
import com.google.dart.compiler.ast.DartClass;
import com.google.dart.compiler.ast.DartComment;
@@ -1144,12 +1145,15 @@ public class Resolver {
@Override
public Element visitSwitchMember(DartSwitchMember x) {
- // visit children
- {
- getContext().pushScope("<switch member>");
- x.visitChildren(this);
- getContext().popScope();
- }
+ getContext().pushScope("<switch member>");
+ x.visitChildren(this);
+ getContext().popScope();
+ return null;
+ }
+
+ @Override
+ public Element visitCase(DartCase x) {
+ super.visitCase(x);
// check fall-through
{
List<DartStatement> statements = x.getStatements();
« no previous file with comments | « no previous file | compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698