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

Unified Diff: tests/language/generic_methods_new_test.dart

Issue 2257813003: Add test case for type with partial parameterization by method type parameter (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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_methods_new_test.dart
diff --git a/tests/language/generic_methods_new_test.dart b/tests/language/generic_methods_new_test.dart
index ea23b949d91dcf095a20b2964ef396bdb0bd25ff..d0acd0a8d19b5f341924f470cc0148e7aa856ded 100644
--- a/tests/language/generic_methods_new_test.dart
+++ b/tests/language/generic_methods_new_test.dart
@@ -21,6 +21,8 @@ C<T> f1<T>(T t) => new C<T>(t);
List<T> f2<T>(T t) => <T>[t];
+Map<T, String> f3<T>(T t) => <T, String>{t: 'hi'};
+
main() {
C c = f1<int>(42);
List i = f2<String>("Hello!");
@@ -28,4 +30,9 @@ main() {
Expect.isTrue(i is List<String> && i is List<int>); // List<dynamic>.
Expect.equals(c.e, 42);
Expect.equals(i[0], "Hello!");
+
+ Map m1 = f3<int>(1);
+ Expect.isTrue(m1 is Map<int, String> && m1 is Map<String, String>);
+ Expect.isFalse(m1 is Map<int, int>);
+ Expect.equals('hi', m1[1]);
}

Powered by Google App Engine
This is Rietveld 408576698