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

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

Issue 2814063003: Support for using generic function types in other AST structures. (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
« no previous file with comments | « pkg/analyzer/lib/src/generated/declaration_resolver.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/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 = (() {
« no previous file with comments | « pkg/analyzer/lib/src/generated/declaration_resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698