Fix for crash on call expression with private identifiers.#42861
Conversation
DanielRosenwasser
left a comment
There was a problem hiding this comment.
I'll do a cherry pick as soon as we're ready to merge. Looks good to me though.
…ing from an any typed variable. (GH microsoft#42860)
5d2e57e to
21eb38b
Compare
| const prop = getPropertyOfType(type, isPrivateIdentifier(name) ? getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText); | ||
| let prop: Symbol | undefined; | ||
| if (isPrivateIdentifier(name)) { | ||
| if (!type.symbol) { |
There was a problem hiding this comment.
Hm, I dislike relying on type.symbol, but it seems like we can only guarantee getNodeLinks((<PropertyAccessExpression>node).expression).resolvedSymbol exists for Identifier LHSs, since as getTypeOfDottedName recurs, it doesn't set it on other interesting LHS node kinds, like checkPropertyAccessExpressionOrQualifiedName sometimes does.
There was a problem hiding this comment.
I initially had an isAnyLike check since I discovered the issue on any, but never and unknown also trigger the issue.
|
@typescript-bot cherry-pick this to release-4.2 |
|
Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into |
Component commits: 21eb38b Fix for crash when using ca call expression on private identifier coming from an any typed variable. (GH microsoft#42860)
|
Hey @RyanCavanaugh, I've opened #42867 for you. |
Component commits: 21eb38b Fix for crash when using ca call expression on private identifier coming from an any typed variable. (GH #42860) Co-authored-by: Titian Cernicova-Dragomir <[email protected]>
Fix for crash when using ca call expression on private identifier coming from an any typed variable.
Fixes #42860