Skip to content

fix(39022): If exported variable is renamed, tsc will generate code with a syntax error #41156

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 1 commit into from
Feb 4, 2021

Conversation

a-tarasyuk
Copy link
Contributor

Fixes #39022

@typescript-bot typescript-bot added the For Milestone Bug PRs that fix a bug with a specific milestone label Oct 18, 2020
Copy link
Member

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

It would be better to always parenthesize. I am also considering whether it would be feasible to introduce our auto-parenthesization from the node factory into the substitution performed by the printer.

Copy link
Member

@rbuckton rbuckton left a comment

Choose a reason for hiding this comment

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

The places where parens are unnnecessary is unavoidable at the moment. I'm investigating a change to the emitter that handles substitution as part of a transformation before printing which would remove the need for this fix, but unfortunately the change I'm investigating is not likely to be ready for 4.2.

Thanks for the effort on this!

@rbuckton rbuckton merged commit 4c118ae into microsoft:master Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

If exported variable is renamed, tsc will generate code with a syntax error
3 participants