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; |