mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 05:43:11 -05:00
Merge pull request #49029 from DavidSouther/fix/44466-contextual-keyword-assertion
fix(44466): Fixes parsing contextual keyword casts as arrow functions
This commit is contained in:
@@ -4538,6 +4538,10 @@ namespace ts {
|
||||
// isn't actually allowed, but we want to treat it as a lambda so we can provide
|
||||
// a good error message.
|
||||
if (isModifierKind(second) && second !== SyntaxKind.AsyncKeyword && lookAhead(nextTokenIsIdentifier)) {
|
||||
if (nextToken() === SyntaxKind.AsKeyword) {
|
||||
// https://github.com/microsoft/TypeScript/issues/44466
|
||||
return Tristate.False;
|
||||
}
|
||||
return Tristate.True;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user