Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: compiler/javatests/com/google/dart/compiler/type/TypeAnalyzerTest.java

Issue 8948001: Updates dartc to recognize 'default' keyword on interface and updated factory method syntax (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Got rid of some problems. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {",

Powered by Google App Engine
This is Rietveld 408576698