Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
=================================================================== |
--- compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (revision 638) |
+++ compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java (working copy) |
@@ -751,7 +751,7 @@ |
DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE); |
analyzeFail("for (;'';) {}", |
DartCompilerErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE); |
- |
+ |
// Foreach tests |
analyze("{ List<String> strings = ['1','2','3']; for (String s in strings) {} }"); |
analyzeFail("{ List<int> ints = [1,2,3]; for (String s in ints) {} }", |
@@ -780,7 +780,7 @@ |
"}"); |
analyzeClasses(fieldNotMethod, DartCompilerErrorCode.FOR_IN_WITH_ITERATOR_FIELD); |
} |
- |
+ |
public void testForEachStatement_Negative2() { |
Map<String, ClassElement> invalidReturnType = loadSource( |
"class A {", |
@@ -1309,7 +1309,7 @@ |
public void testImplementsAndOverrides() { |
analyzeClasses(loadSource( |
"interface Interface {", |
- " void foo();", |
+ " void foo([x = null]);", |
" void bar();", |
"}", |
// Abstract class not reported until first instantiation. |
@@ -1324,7 +1324,7 @@ |
"}", |
"class SubSubClass extends Class {", |
" num bar() { return null; }", // TYPE_NOT_ASSIGNMENT_COMPATIBLE. |
- " void foo([x = null]) {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE. |
+ " void foo() {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE. |
"}", |
"class Usage {", |
" m() {", |
@@ -1344,6 +1344,19 @@ |
DartCompilerErrorCode.ABSTRACT_CLASS); |
} |
+ public void testImplementsAndOverrides2() { |
+ analyzeClasses(loadSource( |
+ "interface Interface {", |
+ " void foo([x = null]);", |
+ "}", |
+ // Abstract class not reported until first instantiation. |
+ "class Class implements Interface {", |
+ " Class() {}", |
+ " void foo() {}", // TYPE_NOT_ASSIGNMENT_COMPATIBLE. |
+ "}"), |
+ DartCompilerErrorCode.CANNOT_OVERRIDE_TYPED_MEMBER); |
+ } |
+ |
public void testOddStuff() { |
Map<String, ClassElement> classes = analyzeClasses(loadSource( |
"class Class {", |