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

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

Issue 2798663003: Fix generic function types in variable declarations (issue 29237) (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 f9c5a45f0b522faa2fff2fcbeeada1fee9bc576e..0f5557f3858fdba04c28adab361cecdb2960b91c 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -2158,6 +2158,38 @@ class B extends A implements Function {
verify([source]);
}
+ test_genericTypeAlias_noTypeParameters() async {
+ Source source = addSource(r'''
+typedef Foo = int Function<T>(T x);
+int foo<T>(T x) => 3;
+void test1() {
+ Foo y = foo;
+ // These two should be equivalent
+ foo<String>("hello");
+ y<String>("hello");
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ test_genericTypeAlias_typeParameters() async {
+ Source source = addSource(r'''
+typedef Foo<S> = S Function<T>(T x);
+int foo<T>(T x) => 3;
+void test1() {
+ Foo<int> y = foo;
+ // These two should be equivalent
+ foo<String>("hello");
+ y<String>("hello");
+}
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
test_implicitConstructorDependencies() async {
// No warning should be generated for the code below; this requires that
// implicit constructors are generated for C1 before C2, even though C1
« pkg/analyzer/lib/src/generated/resolver.dart ('K') | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698