| 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 669891965d3c508c065823e12edb95ab8a0be25d..0cd749bb8b22fca4f845849ba9f9e9caeb02e89c 100644
|
| --- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| +++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerCompilerTest.java
|
| @@ -2017,6 +2017,26 @@ public class TypeAnalyzerCompilerTest extends CompilerTestCase {
|
| }
|
| }
|
|
|
| + /**
|
| + * We should infer types only if variable declared without type.
|
| + */
|
| + public void test_typesPropagation_dontChangeDeclaredType() throws Exception {
|
| + AnalyzeLibraryResult libraryResult = analyzeLibrary(
|
| + "// filler filler filler filler filler filler filler filler filler filler",
|
| + "class A {}",
|
| + "class B extends A {}",
|
| + "main() {",
|
| + " B v = new B();",
|
| + " var v1 = v;",
|
| + " v = new A();",
|
| + " var v2 = v;",
|
| + "}",
|
| + "");
|
| + assertErrors(libraryResult.getErrors());
|
| + assertInferredElementTypeString(testUnit, "v1", "B");
|
| + assertInferredElementTypeString(testUnit, "v2", "B");
|
| + }
|
| +
|
| public void test_typesPropagation_multiAssign() throws Exception {
|
| analyzeLibrary(
|
| "// filler filler filler filler filler filler filler filler filler filler",
|
|
|