Index: pkg/analyzer/test/generated/parser_test.dart |
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart |
index bf816452f190dbc80bccdaec47b7cb314677022f..57e81b22d6072a156d73924c80fa6237a183fd16 100644 |
--- a/pkg/analyzer/test/generated/parser_test.dart |
+++ b/pkg/analyzer/test/generated/parser_test.dart |
@@ -10040,6 +10040,26 @@ class SimpleParserTest extends ParserTestCase { |
expect(arguments, hasLength(3)); |
} |
+ void test_parseClassMember_method_gftReturnType() { |
+ createParser(''' |
+void Function<A>(core.List<core.int> x) m() => null; |
+'''); |
+ ClassMember member = parser.parseClassMember('C'); |
+ expect(member, new isInstanceOf<MethodDeclaration>()); |
+ expect((member as MethodDeclaration).body, |
+ new isInstanceOf<ExpressionFunctionBody>()); |
+ } |
+ |
+ void test_parseClassMember_method_noReturnType() { |
+ createParser(''' |
+Function<A>(core.List<core.int> x) m() => null; |
+'''); |
+ ClassMember member = parser.parseClassMember('C'); |
+ expect(member, new isInstanceOf<MethodDeclaration>()); |
+ expect((member as MethodDeclaration).body, |
+ new isInstanceOf<ExpressionFunctionBody>()); |
+ } |
+ |
void test_parseCombinator_hide() { |
createParser('hide a;'); |
Combinator combinator = parser.parseCombinator(); |
@@ -10640,6 +10660,24 @@ void'''); |
expect(reference.offset, 15); |
} |
+ void test_parseCompilationUnitMember_function_gftReturnType() { |
+ createParser(''' |
+void Function<A>(core.List<core.int> x) f() => null; |
+'''); |
+ CompilationUnit unit = parser.parseCompilationUnit2(); |
+ expect(unit, isNotNull); |
+ expect(unit.declarations, hasLength(1)); |
+ } |
+ |
+ void test_parseCompilationUnitMember_function_noReturnType() { |
+ createParser(''' |
+Function<A>(core.List<core.int> x) f() => null; |
+'''); |
+ CompilationUnit unit = parser.parseCompilationUnit2(); |
+ expect(unit, isNotNull); |
+ expect(unit.declarations, hasLength(1)); |
+ } |
+ |
void test_parseConfiguration_noOperator_dottedIdentifier() { |
createParser("if (a.b) 'c.dart'"); |
Configuration configuration = parser.parseConfiguration(); |
@@ -11303,6 +11341,34 @@ void'''); |
expect(typeName.typeArguments, isNull); |
} |
+ void test_parseStatement_function_gftReturnType() { |
+ createParser(''' |
+void Function<A>(core.List<core.int> x) m() => null; |
+'''); |
+ Statement statement = parser.parseStatement2(); |
+ expect(statement, new isInstanceOf<FunctionDeclarationStatement>()); |
+ expect( |
+ (statement as FunctionDeclarationStatement) |
+ .functionDeclaration |
+ .functionExpression |
+ .body, |
+ new isInstanceOf<ExpressionFunctionBody>()); |
+ } |
+ |
+ void test_parseStatement_function_noReturnType() { |
+ createParser(''' |
+Function<A>(core.List<core.int> x) m() => null; |
+'''); |
+ Statement statement = parser.parseStatement2(); |
+ expect(statement, new isInstanceOf<FunctionDeclarationStatement>()); |
+ expect( |
+ (statement as FunctionDeclarationStatement) |
+ .functionDeclaration |
+ .functionExpression |
+ .body, |
+ new isInstanceOf<ExpressionFunctionBody>()); |
+ } |
+ |
void test_parseStatements_multiple() { |
List<Statement> statements = parseStatements("return; return;", 2); |
expect(statements, hasLength(2)); |