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

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java

Issue 11555015: Issue 2862. Report warning when 'default' of switch has fall-through. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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 | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
index 01a41796618f924c73f4066c83cb4354308bcafe..bb05a33de629fd2a0176742980ca4d67007c8643 100644
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
@@ -470,6 +470,8 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
" throw new Exception();",
" case 4:",
" bar();",
+ " default:",
+ " bar();",
" }",
" }",
"}",
@@ -477,7 +479,8 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
"");
assertErrors(
libraryResult.getErrors(),
- errEx(ResolverErrorCode.SWITCH_CASE_FALL_THROUGH, 14, 9, 6));
+ errEx(ResolverErrorCode.SWITCH_CASE_FALL_THROUGH, 14, 9, 6),
+ errEx(ResolverErrorCode.SWITCH_CASE_FALL_THROUGH, 16, 9, 6));
}
/**
@@ -3363,6 +3366,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
" switch (true) {",
" default:",
" int v = foo;",
+ " break;",
" }",
"}",
"");
« no previous file with comments | « compiler/java/com/google/dart/compiler/resolver/Resolver.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698