Skip to content

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

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:js-declaration-emit-doesnt-rename-import
Aug 16, 2023
Merged

Don't track private symbol roots in other files during js declaration emit#55390
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
weswigham:js-declaration-emit-doesnt-rename-import

Conversation

@weswigham

Copy link
Copy Markdown
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
Wesley Wigham (weswigham) merged commit ffec968 into microsoft:mainAug 16, 2023
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamFor Milestone BugPRs 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

@weswigham@gabritto@typescript-bot