Skip to content

Avoid bogus circularity error on context sensitive constructor property assignments #44601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

weswigham
Copy link
Member

Fixes #44581

@weswigham weswigham requested review from orta and sandersn June 15, 2021 19:00
@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Jun 15, 2021
@weswigham weswigham force-pushed the constructor-property-assignments branch from e5594e6 to 39d4a59 Compare June 15, 2021 19:01
}
return undefined;

function tryGetPrivateIdentifierPropertyOfType(type: Type, id: PrivateIdentifier) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this nested (it doesn't capture e) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Just because it wasn't used outside of this function. :)

Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

OK, I'm convinced about the approach. Just needs a test in JS, since I think that evolving class properties work in JS, and may incorrectly get marked as ThisProperty assignments there.

@weswigham
Copy link
Member Author

@sandersn done, there's now a JS test, and the code's been shuffled a bit to cover the JS case as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Milestone Bug PRs that fix a bug with a specific milestone
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Class attribute inference with template literals
5 participants