| 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 556cc154177ec5cb1778c1abb29237d463aabfca..f6e39c7fabbae35e24980ab184d578c6e80f5995 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -1948,8 +1948,9 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| assertInferredElementTypeString(libraryResult, "v2", "bool");
|
| }
|
|
|
| - public void test_getType_getterInSwitch() throws Exception {
|
| + public void test_getType_getterInSwitch_default() throws Exception {
|
| AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| "int get foo() {}",
|
| "f() {",
|
| " switch (true) {",
|
| @@ -1962,6 +1963,45 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| }
|
|
|
| /**
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=3515
|
| + */
|
| + public void test_getType_getterInSwitchExpression_topLevel() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "int get foo() => 42;",
|
| + "f() {",
|
| + " switch (foo) {",
|
| + " case 2:",
|
| + " break;",
|
| + " }",
|
| + "}",
|
| + "");
|
| + assertErrors(libraryResult.getErrors());
|
| + }
|
| +
|
| + /**
|
| + * <p>
|
| + * http://code.google.com/p/dart/issues/detail?id=3515
|
| + */
|
| + public void test_getType_getterInSwitchExpression_inClass() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A<T> {",
|
| + " T get foo() => null;",
|
| + "}",
|
| + "f() {",
|
| + " A<int> a = new A<int>();",
|
| + " switch (a.foo) {",
|
| + " case 2:",
|
| + " break;",
|
| + " }",
|
| + "}",
|
| + "");
|
| + assertErrors(libraryResult.getErrors());
|
| + }
|
| +
|
| + /**
|
| * Asserts that {@link Element} with given name has expected type.
|
| */
|
| private void assertInferredElementTypeString(
|
|
|