Index: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
diff --git a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
index 69040345ef633498e735fb6d97a2b4592592f202..521556b59da22c672676e7c846673481b6c118d8 100644 |
--- a/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
+++ b/compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java |
@@ -814,11 +814,11 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase { |
" Foo.foo() {}", |
" Foo.bar([int i = null]) {}", |
"}", |
- "interface Bar<T> factory Baz {", |
+ "interface Bar<T> factory Baz<T> {", |
" Bar.make();", |
"}", |
- "class Baz {", |
- " factory Bar<S>.make(S x) { return null; }", |
+ "class Baz<T> {", |
+ " factory Bar.make(T x) { return null; }", |
"}")); |
analyze("Foo x = new Foo(0);"); |
@@ -834,9 +834,23 @@ public class TypeAnalyzerTest extends TypeAnalyzerTestCase { |
analyzeFail("Foo x = new Foo.bar('');", TypeErrorCode.TYPE_NOT_ASSIGNMENT_COMPATIBLE); |
analyzeFail("Foo x = new Foo.bar(0, null);", TypeErrorCode.EXTRA_ARGUMENT); |
- analyze("Bar<String> x = new Bar<String>.make('');"); |
+ analyze("Bar<String> x = new Bar.make('');"); |
} |
+ public void testAssignableTypeArg() { |
+ analyzeClasses(loadSource( |
+ "interface Bar<T> factory Baz<T> {", |
+ " Bar.make();", |
+ "}", |
+ "class Baz<T> {", |
+ " Baz(T x) { return null; }", |
+ " factory Bar.make(T x) { return null; }", |
+ "}")); |
+ analyze("Baz<String> x = new Baz<String>('');"); |
+ analyze("Bar<String> x = new Bar.make('');"); |
+ analyze("Bar<String> x = new Bar<String>.make('');"); |
+ } |
+ |
public void testOddStuff() { |
Map<String, ClassElement> classes = analyzeClasses(loadSource( |
"class Class {", |