Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix for crash on call expression with private identifiers.#42861

Merged
DanielRosenwasser merged 1 commit into
microsoft:mastermicrosoft/TypeScript:masterfrom
bloomberg:fix-call-expression-with-private-identifier-on-anybloomberg/TypeScript:fix-call-expression-with-private-identifier-on-anyCopy head branch name to clipboard
Feb 18, 2021
Merged

Fix for crash on call expression with private identifiers.#42861
DanielRosenwasser merged 1 commit into
microsoft:mastermicrosoft/TypeScript:masterfrom
bloomberg:fix-call-expression-with-private-identifier-on-anybloomberg/TypeScript:fix-call-expression-with-private-identifier-on-anyCopy head branch name to clipboard

Conversation

@dragomirtitian

@dragomirtitian dragomirtitian commented Feb 18, 2021

Copy link
Copy Markdown
Contributor

Fix for crash when using ca call expression on private identifier coming from an any typed variable.

Fixes #42860

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Feb 18, 2021

@DanielRosenwasser DanielRosenwasser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a cherry pick as soon as we're ready to merge. Looks good to me though.

@typescript-bot typescript-bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Feb 18, 2021
@dragomirtitian dragomirtitian force-pushed the fix-call-expression-with-private-identifier-on-any branch from 5d2e57e to 21eb38b Compare February 18, 2021 20:53

@weswigham weswigham left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK to me, my minor lament aside. @sandersn has a bit more context here though.

Comment thread src/compiler/checker.ts
const prop = getPropertyOfType(type, isPrivateIdentifier(name) ? getSymbolNameForPrivateIdentifier(type.symbol, name.escapedText) : name.escapedText);
let prop: Symbol | undefined;
if (isPrivateIdentifier(name)) {
if (!type.symbol) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I initially had an isAnyLike check since I discovered the issue on any, but never and unknown also trigger the issue.

@RyanCavanaugh

Copy link
Copy Markdown
Member

@typescript-bot cherry-pick this to release-4.2

@typescript-bot

typescript-bot commented Feb 18, 2021

Copy link
Copy Markdown
Contributor

Heya @RyanCavanaugh, I've started to run the task to cherry-pick this into release-4.2 on this PR at 21eb38b. You can monitor the build here.

@DanielRosenwasser DanielRosenwasser merged commit a2ed469 into microsoft:master Feb 18, 2021
typescript-bot pushed a commit to typescript-bot/TypeScript that referenced this pull request Feb 18, 2021
Component commits:
21eb38b Fix for crash when using ca call expression on private identifier coming from an any typed variable. (GH microsoft#42860)
@typescript-bot

Copy link
Copy Markdown
Contributor

Hey @RyanCavanaugh, I've opened #42867 for you.

DanielRosenwasser pushed a commit that referenced this pull request Feb 18, 2021
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 <tcernicovad1@bloomberg.net>
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: Compiler crash on call expression with private identifier on an any typed variable in 4.2RC

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.