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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 2814443005: Fix for summarization of generic function type aliases and support for resynthesizing. (Closed)
Patch Set: Created 3 years, 8 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/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index e89057b3cc1f84e63c1a64815aeda7187c6fac26..e516d5d9e6566804a721d3f7c97e68b52e33dc24 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -2158,7 +2158,7 @@ class B extends A implements Function {
verify([source]);
}
- test_genericTypeAlias_fieldAndReturnType() async {
+ test_genericTypeAlias_fieldAndReturnType_noTypeParameters() async {
Source source = addSource(r'''
typedef Foo = int Function<T>(T x);
int foo<T>(T x) => 3;
@@ -2179,6 +2179,48 @@ class A {
verify([source]);
}
+ test_genericTypeAlias_fieldAndReturnType_typeParameters_arguments() async {
+ Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+Foo<int> bar() => foo;
+void test1() {
+ bar()<String>("hello");
+}
+
+class A {
+ Foo<int> f;
+ void test() {
+ f<String>("hello");
+ }
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ test_genericTypeAlias_fieldAndReturnType_typeParameters_noArguments() async {
+ Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+Foo bar() => foo;
+void test1() {
+ bar()<String>("hello");
+}
+
+class A {
+ Foo f;
+ void test() {
+ f<String>("hello");
+ }
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
test_genericTypeAlias_noTypeParameters() async {
Source source = addSource(r'''
typedef Foo = int Function<T>(T x);
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_driver_test.dart ('k') | pkg/analyzer/test/src/summary/element_text.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698