Call computeTypeVar rather than parseTypeArguments when parsing expressions

Change-Id: I4423d1fc4941d7e7fc93c02d89ab81ade46ecf1d
Reviewed-on: https://dart-review.googlesource.com/52720
Commit-Queue: Dan Rubel <danrubel@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
danrubel 2018-05-08 15:17:02 +00:00 committed by commit-bot@chromium.org
parent 8f6c6c2a8e
commit 1d8620044a

View file

@ -86,10 +86,13 @@ import 'type_continuation.dart' show TypeContinuation;
import 'type_info.dart' import 'type_info.dart'
show show
TypeInfo, TypeInfo,
TypeParamOrArgInfo,
computeType, computeType,
computeTypeParamOrArg,
isGeneralizedFunctionType, isGeneralizedFunctionType,
isValidTypeReference, isValidTypeReference,
noType; noType,
noTypeParamOrArg;
import 'type_info_impl.dart' show skipTypeVariables; import 'type_info_impl.dart' show skipTypeVariables;
@ -4112,10 +4115,12 @@ class Parser {
TokenType type = next.type; TokenType type = next.type;
int tokenLevel = type.precedence; int tokenLevel = type.precedence;
Token typeArguments; Token typeArguments;
if (isValidMethodTypeArguments(next)) { TypeParamOrArgInfo typeArg = computeTypeParamOrArg(token);
// For example a(b)<T>(c), where token is '<'. if (typeArg != noTypeParamOrArg &&
optional('(', typeArg.skip(token).next)) {
// For example a(b)<T>(c), where token is before '<'.
typeArguments = next; typeArguments = next;
token = parseTypeArgumentsOpt(token); token = typeArg.parseArguments(token, this);
next = token.next; next = token.next;
assert(optional('(', next)); assert(optional('(', next));
type = next.type; type = next.type;