Skip to content

Commit aef58a5

Browse files
author
Kanchalai Tanglertsampan
committed
Address Github #11081 when we start paring "1" in type and keep going instead of terminate when see ")"
1 parent 95c3ecc commit aef58a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,8 +1394,8 @@ namespace ts {
13941394
// Tokens other than ')' and ']' (the latter for index signatures) are here for better error recovery
13951395
return token() === SyntaxKind.CloseParenToken || token() === SyntaxKind.CloseBracketToken /*|| token === SyntaxKind.OpenBraceToken*/;
13961396
case ParsingContext.TypeArguments:
1397-
// Tokens other than '>' are here for better error recovery
1398-
return token() === SyntaxKind.GreaterThanToken || token() === SyntaxKind.OpenParenToken;
1397+
// All other tokens should cause the type-argument to terminate except comma token
1398+
return token() !== SyntaxKind.CommaToken;
13991399
case ParsingContext.HeritageClauses:
14001400
return token() === SyntaxKind.OpenBraceToken || token() === SyntaxKind.CloseBraceToken;
14011401
case ParsingContext.JsxAttributes:

0 commit comments

Comments
 (0)