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

Unified Diff: pkg/analyzer/lib/src/generated/parser.dart

Issue 2808403005: Fix another parser bug (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698