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

Unified Diff: pkg/analyzer/lib/src/generated/parser.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 | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | 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 411f6a945aef94b069713388d253027542167140..c16281ee5b4b91c871d2a0476d07226972377398 100644
--- a/pkg/analyzer/lib/src/generated/parser.dart
+++ b/pkg/analyzer/lib/src/generated/parser.dart
@@ -6876,6 +6876,14 @@ class Parser {
keyword != Keyword.OPERATOR &&
(_tokenMatchesIdentifier(next) ||
_tokenMatches(next, TokenType.LT))) {
+ Token afterTypeParameters = _skipTypeParameterList(next);
+ if (afterTypeParameters != null &&
+ _tokenMatches(afterTypeParameters, TokenType.OPEN_PAREN)) {
+ // If the identifier is followed by type parameters and a parenthesis,
+ // then the identifier is the name of a generic method, not a return
+ // type.
+ return null;
+ }
return parseReturnType();
}
Token next2 = next.next;
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698