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

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

Issue 1713083002: Fix inconsistency with LinkedReference.numTypeParameters (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
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 c39e6f4009d57a8ba6aa847db23380829a78e2e2..85614df09d11bb240b8d80be19a65ee1c069a271 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -2873,6 +2873,62 @@ get x => null;''');
checkLibrary('import "a.dart"; import "b.dart"; C c; D d;');
}
+ test_inferred_function_type_for_variable_in_generic_function() {
+ // In the code below, `x` has an inferred type of `() => int`, with 2
+ // (unused) type parameters from the enclosing top level function.
+ checkLibrary('''
+f<U, V>() {
+ var x = () => 0;
+}
+''');
+ }
+
+ test_inferred_function_type_in_generic_class_constructor() {
+ // In the code below, `() => () => 0` has an inferred return type of
+ // `() => int`, with 2 (unused) type parameters from the enclosing class.
+ checkLibrary('''
+class C<U, V> {
+ final x;
+ C() : x = (() => () => 0);
+}
+''');
+ }
+
+ test_inferred_function_type_in_generic_class_getter() {
+ // In the code below, `() => () => 0` has an inferred return type of
+ // `() => int`, with 2 (unused) type parameters from the enclosing class.
+ checkLibrary('''
+class C<U, V> {
+ get x => () => () => 0;
+}
+''');
+ }
+
+ test_inferred_function_type_in_generic_class_in_generic_method() {
+ // In the code below, `() => () => 0` has an inferred return type of
+ // `() => int`, with 3 (unused) type parameters from the enclosing class
+ // and method.
+ checkLibrary('''
+class C<T> {
+ f<U, V>() {
+ print(() => () => 0);
+ }
+}
+''');
+ }
+
+ test_inferred_function_type_in_generic_class_setter() {
+ // In the code below, `() => () => 0` has an inferred return type of
+ // `() => int`, with 2 (unused) type parameters from the enclosing class.
+ checkLibrary('''
+class C<U, V> {
+ void set x(value) {
+ print(() => () => 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/summarize_elements.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698