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

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

Issue 2551533002: Handle generic local functions without a return type (issue 27965) (Closed)
Patch Set: Created 4 years 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/parser.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/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index ad1ceaaf75d27fa7c019f3576e55b39127eff75f..d85fc098bd39e2ddaee18f7d8beed04f71b5c307 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -1919,13 +1919,6 @@ class Foo {
[ParserErrorCode.MISSING_IDENTIFIER, ParserErrorCode.EXPECTED_TOKEN]);
}
- void test_missingIdentifier_functionDeclaration_returnTypeWithoutName() {
- createParser('A<T> () {}');
- Statement statement = parser.parseFunctionDeclarationStatement();
- expectNotNullIfNoErrors(statement);
- listener.assertErrorsWithCodes([ParserErrorCode.MISSING_IDENTIFIER]);
- }
-
void test_missingIdentifier_inEnum() {
createParser('enum E {, TWO}');
EnumDeclaration declaration =
@@ -9559,6 +9552,17 @@ void''');
isNotNull);
}
+ void test_parseFunctionDeclarationStatement_typeParameters_noReturnType() {
+ createParser('f<E>(E p) => p * 2;');
+ FunctionDeclarationStatement statement =
+ parser.parseFunctionDeclarationStatement();
+ expectNotNullIfNoErrors(statement);
+ listener.assertNoErrors();
+ expect(statement.functionDeclaration, isNotNull);
+ expect(statement.functionDeclaration.functionExpression.typeParameters,
+ isNotNull);
+ }
+
void test_parseFunctionExpression_body_inExpression() {
createParser('(int i) => i++');
FunctionExpression expression = parser.parseFunctionExpression();
@@ -11867,7 +11871,6 @@ void''');
isNotNull);
}
- @failingTest
void test_parseStatement_functionDeclaration_noReturnType_typeParameters() {
createParser('f<E>(a, b) {};');
Statement statement = parser.parseStatement2();
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698