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