Call computeType rather than parseType

Change-Id: I4d67e8742997181775320b596443ea9dd78be60d
Reviewed-on: https://dart-review.googlesource.com/56241
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Dan Rubel <danrubel@google.com>
This commit is contained in:
Dan Rubel 2018-05-22 21:47:14 +00:00 committed by commit-bot@chromium.org
parent 2c8c05f877
commit 3bdd173175
2 changed files with 7 additions and 2 deletions

View file

@ -43,7 +43,12 @@ class TryStatementTest extends PartialCodeTest {
ParserErrorCode.EXPECTED_TOKEN
],
"try {} on _s_ {}",
failing: allExceptEof),
failing: [
'block',
'labeled',
'localFunctionNonVoid',
'localFunctionVoid'
]),
new TestDescriptor('on_identifier', 'try {} on A',
[ParserErrorCode.EXPECTED_TOKEN], "try {} on A {}",
failing: ['block']),

View file

@ -5609,7 +5609,7 @@ class Parser {
if (identical(value, 'on')) {
// 'on' type catchPart?
onKeyword = token;
lastConsumed = parseType(token);
lastConsumed = computeType(token, true).ensureTypeNotVoid(token, this);
token = lastConsumed.next;
value = token.stringValue;
}