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

Unified Diff: tests/language/generic_creation_test.dart

Issue 12210138: Add substitution for classes that use type variables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 10 months 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: tests/language/generic_creation_test.dart
diff --git a/tests/language/generic_creation_test.dart b/tests/language/generic_creation_test.dart
index 55dbd2680d305cda659631e989764aa5244eb829..4bfd4d49552420e948d9620bf8644d010c81a398 100644
--- a/tests/language/generic_creation_test.dart
+++ b/tests/language/generic_creation_test.dart
@@ -10,6 +10,12 @@ class A<X, Y, Z> {
wrap() => new A<A<X, X, X>, A<Y, Y, Y>, A<Z, Z, Z>>();
}
+class B extends A<U, V, W> {}
+
+class C<T> extends A<U, T, W> {}
+
+class D<X, Y, Z> extends A<Y, Z, X> {}
+
class U {}
class V {}
class W {}
@@ -23,4 +29,10 @@ main() {
sameType(new A<U, U, U>(), a.first());
sameType(new A<W, W, W>(), a.last());
sameType(new A<A<U, U, U>, A<V, V, V>, A<W, W, W>>(), a.wrap());
+ B b = new B();
+ sameType(new A<A<U, U, U>, A<V, V, V>, A<W, W, W>>(), b.wrap());
+ C c = new C<V>();
+ sameType(new A<A<U, U, U>, A<V, V, V>, A<W, W, W>>(), c.wrap());
+ D d = new D<U, V, W>();
+ sameType(new A<A<V, V, V>, A<W, W, W>, A<U, U, U>>(), d.wrap());
}

Powered by Google App Engine
This is Rietveld 408576698