mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 03:23:08 -06:00
Move away from a grammar error when a real parse error occurs.
This commit is contained in:
parent
cfb74249c8
commit
4a76206e0c
@ -2255,7 +2255,7 @@ module ts {
|
||||
// Check for that common pattern and report a better error message.
|
||||
if (inNewExpression && parseOptional(SyntaxKind.CloseBracketToken)) {
|
||||
indexedAccess.index = createMissingNode();
|
||||
grammarErrorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
|
||||
errorAtPos(dotOrBracketStart, scanner.getStartPos() - dotOrBracketStart, Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead);
|
||||
}
|
||||
else {
|
||||
indexedAccess.index = parseExpression();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user