| 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 c7c0ee17ff1cdfad0652e170e97008ea34e0db53..584e6bf05e9a847655636022249c7327d9c808df 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -124,6 +124,7 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| " case 0: qwerty: {",
|
| " break qwerty;",
|
| " }",
|
| + " break;",
|
| " }",
|
| "}",
|
| "");
|
| @@ -437,6 +438,36 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| "");
|
| assertErrors(libraryResult.getErrors());
|
| }
|
| +
|
| + /**
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=2862
|
| + */
|
| + public void test_switchCase_fallThrough() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "foo(int x) {",
|
| + " while (true) {",
|
| + " switch (x) {",
|
| + " case 0:",
|
| + " break;",
|
| + " case 1:",
|
| + " continue;",
|
| + " case 2:",
|
| + " return;",
|
| + " case 3:",
|
| + " throw new Exception();",
|
| + " case 4:",
|
| + " bar();",
|
| + " }",
|
| + " }",
|
| + "}",
|
| + "bar() {}",
|
| + "");
|
| + assertErrors(
|
| + libraryResult.getErrors(),
|
| + errEx(ResolverErrorCode.SWITCH_CASE_FALL_THROUGH, 14, 9, 6));
|
| + }
|
|
|
| /**
|
| * Language specification requires that factory should be declared in class. However declaring
|
|
|