Skip to content

Don't track private symbol roots in other files during js declaration emit #55390

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

Conversation

weswigham
Copy link
Member

Fixes #55375

The linked issue only repro'd with strict: false and strictNullChecks: true because without those set, we'd reuse input type nodes much more, and not reprint the union type for the field in the Option type. When we traverse that field, we'd see the Test member in another module, and mistakenly try to add it as something to print in the current file. Now, we have guards against actually doing that already, but traversing it at all caused us to reserve the Test name for that symbol in the index file, and thus mangle the original Test name for the other symbol when we reprinted the import in the file later.

@weswigham weswigham requested review from sandersn and gabritto August 15, 2023 23:52
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Aug 15, 2023
@weswigham weswigham merged commit ffec968 into microsoft:main Aug 16, 2023
snovader pushed a commit to EG-A-S/TypeScript that referenced this pull request Sep 23, 2023
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.

Invalid type definitions generated when imported classes have same name
3 participants