Skip to content

markAliasReferenced should include ExportValue as well#51219

Merged
rbuckton merged 1 commit into
mainfrom
fix47598
Oct 19, 2022
Merged

markAliasReferenced should include ExportValue as well#51219
rbuckton merged 1 commit into
mainfrom
fix47598

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

@rbuckton rbuckton commented Oct 18, 2022

In markAliasReferenced we check that the SymbolFlags of the resolved symbol includes SymbolFlags.Value. However, if the default export points to a variable that is also exported, and that variable merges with a type that is not, the alias we create when importing the default export points to the local symbol (which has SymbolFlags.Interface | SymbolFlags.ExportValue) and not the export symbol (which has SymbolFlags.Value).

Since you can only end up with SymbolFlags.ExportValue if the export symbol is a value, this change considers such a local symbol to also be a value for the purpose of marking the import alias as referenced.

Fixes #47598

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

Import wrongly elided with a combination of default export, named export, non-exported type

4 participants