-
Notifications
You must be signed in to change notification settings - Fork 13.4k
isTypeOfExpression is broken #20875
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: APIRelates to the public API for TypeScriptRelates to the public API for TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
TypeScript Version: 2.6.2
Code
Expected behavior:
ts.isTypeofExpressionshould returntrue(only) forTypeOfExpressionnodes.Actual behavior:
It returns
trueforAwaitExpressionnodes instead.Reason
The nodes both get created correctly (
TypeOfExpressionhas kind189like it should), but the generated code forisTypeOfExpressionuses the wrong number forkind: (fromtsc.ts, starting on line 9132)Note that some code uses the correct
kind:Note that this issue also exists on master, even though the numbers for
SyntaxKindenum values have changed.I couldn't find where this code gets generated, so I haven't been able to investigate further.