Index: pkg/analyzer/lib/src/generated/parser.dart |
diff --git a/pkg/analyzer/lib/src/generated/parser.dart b/pkg/analyzer/lib/src/generated/parser.dart |
index 839cf77b2fd6cb27c71a4166c7b41acbc7914bb2..d857f68d78925cc19fd32cb51448608d15767beb 100644 |
--- a/pkg/analyzer/lib/src/generated/parser.dart |
+++ b/pkg/analyzer/lib/src/generated/parser.dart |
@@ -542,8 +542,12 @@ class Parser { |
// There was no type name, so this can't be a declaration. |
return false; |
} |
- if (_tokenMatchesKeyword(token, Keyword.FUNCTION)) { |
+ if (_atGenericFunctionTypeAfterReturnType(token)) { |
token = skipGenericFunctionTypeAfterReturnType(token); |
+ if (token == null) { |
+ // There was no type name, so this can't be a declaration. |
+ return false; |
+ } |
} |
if (token.type != TokenType.IDENTIFIER) { |
allowAdditionalTokens = false; |