Skip to content

Fix completions crash on transient exported property named 'default' #42583

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 2 commits into from
Feb 4, 2021

Conversation

andrewbranch
Copy link
Member

Fixes #40991

Also includes a drive-by improvement to allow us to get a name for default or export= when the target is an identifier with parentheses, non-null assertions, type assertions, etc., instead of just a bare identifier.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Feb 1, 2021
Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

These all seem like sensible changes, but it's not immediately obvious to me what was actually crashing. Maybe aliased.parent was undefined?

@andrewbranch
Copy link
Member Author

In this case default was an intersection property where the constituent properties had different parents. So on the intersection property, there is no parent, because it’s not clear why one parent would be favored over the other. A “real” default export should never be an intersection property, or transient at all (this was just manually named “default”), so there was no reason to treat it as an auto-importable export.

@andrewbranch andrewbranch merged commit 258be21 into microsoft:master Feb 4, 2021
@andrewbranch andrewbranch deleted the bug/40991 branch February 4, 2021 18:22
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
None yet
Development

Successfully merging this pull request may close these issues.

esModuleInterop:true breaks intellisense
3 participants