Index: pkg/analyzer/test/generated/declaration_resolver_test.dart |
diff --git a/pkg/analyzer/test/generated/declaration_resolver_test.dart b/pkg/analyzer/test/generated/declaration_resolver_test.dart |
index 2a034bc5d3f540b0c327e3346a2294ad0c7f9d2f..38d635eae049375f0984e66ce3dcc171b1497d87 100644 |
--- a/pkg/analyzer/test/generated/declaration_resolver_test.dart |
+++ b/pkg/analyzer/test/generated/declaration_resolver_test.dart |
@@ -468,6 +468,58 @@ void set zzz(_) {} |
expect(getterName.staticElement, same(setterElement)); |
} |
+ test_genericFunction_asFunctionReturnType() async { |
+ String code = r''' |
+Function(int, String) f() => null; |
+'''; |
+ CompilationUnit unit = await resolveSource(code); |
+ // re-resolve |
+ _cloneResolveUnit(unit); |
+ // no other validations than built into DeclarationResolver |
+ } |
+ |
+ test_genericFunction_asGenericFunctionReturnType() async { |
+ String code = r''' |
+typedef F<T> = int Function(T t, S s) Function<S>(int); |
+'''; |
+ CompilationUnit unit = await resolveSource(code); |
+ // re-resolve |
+ _cloneResolveUnit(unit); |
+ // no other validations than built into DeclarationResolver |
+ } |
+ |
+ test_genericFunction_asMethodReturnType() async { |
+ String code = r''' |
+class C { |
+ Function(int, String) m() => null; |
+} |
+'''; |
+ CompilationUnit unit = await resolveSource(code); |
+ // re-resolve |
+ _cloneResolveUnit(unit); |
+ // no other validations than built into DeclarationResolver |
+ } |
+ |
+ test_genericFunction_asParameterReturnType() async { |
+ String code = r''' |
+f(Function(int, String) p) => null; |
+'''; |
+ CompilationUnit unit = await resolveSource(code); |
+ // re-resolve |
+ _cloneResolveUnit(unit); |
+ // no other validations than built into DeclarationResolver |
+ } |
+ |
+ test_genericFunction_asTopLevelVariableType() async { |
+ String code = r''' |
+int Function(int, String) v; |
+'''; |
+ CompilationUnit unit = await resolveSource(code); |
+ // re-resolve |
+ _cloneResolveUnit(unit); |
+ // no other validations than built into DeclarationResolver |
+ } |
+ |
test_invalid_functionDeclaration_getter_inFunction() async { |
String code = r''' |
var v = (() { |