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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1712583004: Test and fix resynthesis of generic closures. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Reference bug from TODO comments. Created 4 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index 85614df09d11bb240b8d80be19a65ee1c069a271..3fbae24d5ad6436242c31cfe9b5fddf7911d8de5 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -2929,6 +2929,44 @@ class C<U, V> {
''');
}
+ test_inferred_function_type_in_generic_closure() {
+ if (!options.strongMode) {
+ // The test below uses generic comment syntax because proper generic
+ // method syntax doesn't support generic closures. So it can only run in
+ // strong mode.
+ // TODO(paulberry): once proper generic method syntax supports generic
+ // closures, rewrite the test below without using generic comment syntax,
+ // and remove this hack. See dartbug.com/25819
+ return;
+ }
+ // In the code below, `<U, V>() => () => 0` has an inferred return type of
+ // `() => int`, with 3 (unused) type parameters.
+ checkLibrary('''
+f<T>() {
+ print(/*<U, V>*/() => () => 0);
+}
+''');
+ }
+
+ test_inferred_generic_function_type_in_generic_closure() {
+ if (!options.strongMode) {
+ // The test below uses generic comment syntax because proper generic
+ // method syntax doesn't support generic closures. So it can only run in
+ // strong mode.
+ // TODO(paulberry): once proper generic method syntax supports generic
+ // closures, rewrite the test below without using generic comment syntax,
+ // and remove this hack. See dartbug.com/25819
+ return;
+ }
+ // In the code below, `<U, V>() => <W, X, Y, Z>() => 0` has an inferred
+ // return type of `() => int`, with 7 (unused) type parameters.
+ checkLibrary('''
+f<T>() {
+ print(/*<U, V>*/() => /*<W, X, Y, Z>*/() => 0);
+}
+''');
+ }
+
test_inferred_type_is_typedef() {
checkLibrary('typedef int F(String s);'
' class C extends D { var v; }'
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698