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

Unified Diff: pkg/kernel/testcases/closures_type_vars/type_variables.dart

Issue 2989563002: Preserve type variables in closure conversion. (Closed)
Patch Set: Update binary.md. Created 3 years, 5 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: pkg/kernel/testcases/closures_type_vars/type_variables.dart
diff --git a/pkg/kernel/testcases/closures/type_variables.dart b/pkg/kernel/testcases/closures_type_vars/type_variables.dart
similarity index 87%
rename from pkg/kernel/testcases/closures/type_variables.dart
rename to pkg/kernel/testcases/closures_type_vars/type_variables.dart
index 5883e7372d6e9555d17b909df0db6f4ba372eca6..2de2994f3f9d41e6a8a97eb53c4500310b5755e9 100644
--- a/pkg/kernel/testcases/closures/type_variables.dart
+++ b/pkg/kernel/testcases/closures_type_vars/type_variables.dart
@@ -29,6 +29,15 @@ class C<T, S> {
C.internal();
}
+fn<A>(A x) {
+ var fn2 = (A x2) {
+ var l = <A>[];
+ l.add(x2);
+ return l;
+ };
+ return fn2(x);
+}
+
main(arguments) {
print(new C<String, String>().foo(null)(arguments.first));
dynamic c = new C<int, int>().baz()()();
@@ -37,4 +46,5 @@ main(arguments) {
throw "$c passes type test 'is C<String, String>'";
}
print(c);
+ print(fn<int>(3));
}

Powered by Google App Engine
This is Rietveld 408576698