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

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

Issue 10887028: Issue 4785. Fix for resolving label for block in switch/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/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 767202d929d236d3b2b85d7d60a8c037d2f3f9bf..8627595d56ea43740d3b50237991495fdeee020e 100644
--- a/compiler/java/com/google/dart/compiler/resolver/Resolver.java
+++ b/compiler/java/com/google/dart/compiler/resolver/Resolver.java
@@ -783,11 +783,12 @@ public class Resolver {
@Override
public Element visitLabel(DartLabel x) {
DartNode parent = x.getParent();
- if (!(parent instanceof DartSwitchMember)) {
+ if (!(parent instanceof DartSwitchMember && ((DartSwitchMember) parent).getLabels().contains(
+ x))) {
LabelElement labelElement;
DartStatement childStatement = x.getStatement();
while (childStatement instanceof DartLabel) {
- childStatement = ((DartLabel)childStatement).getStatement();
+ childStatement = ((DartLabel) childStatement).getStatement();
}
if (childStatement instanceof DartSwitchStatement) {
labelElement = Elements.switchLabelElement(x, x.getName(), innermostFunction);
« 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