| 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..dd742fbcc247149c225e589dfbf9221350307573 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
|
| @@ -1338,6 +1369,18 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| errEx(ResolverErrorCode.CANNOT_ASSIGN_TO_FINAL, 11, 3, 1),
|
| errEx(TypeErrorCode.FIELD_IS_FINAL, 13, 5, 1));
|
| }
|
| +
|
| + public void test_identicalFunction() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + getName(),
|
| + makeCode(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "const A = 1;",
|
| + "const B = 2;",
|
| + "const C = identical(A, B);",
|
| + ""));
|
| + assertErrors(libraryResult.getErrors());
|
| + }
|
|
|
| /**
|
| * It is a compile-time error to use type variables in "const" instance creation.
|
|
|