Skip to content

Reuse type nodes from optional parameters even when not written as a union with undefined #48605

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 6 commits into from
Apr 8, 2022

Conversation

andrewbranch
Copy link
Member

Fixes #47849 as much as we're going to fix it, at least for now. I did a lot of exploration in #48491 into doing more to find the type alias, but didn't feel confident in the approach. @weswigham suggested that an alternative would be to bind type aliases of entity names as actual aliases, which we could explore in the future. But ultimately it’s hard to argue that writing an ImportType for something exported from a module is a bug per se. I talked to @justinlnx and the real issue with the ImportType declaration was that the module specifier being emitted was problematic for a number of configuration-specific reasons, and if needed, we would be happy to look at module specifier resolution bugs separately.

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 7, 2022
@andrewbranch andrewbranch requested a review from weswigham April 7, 2022 22:55
@andrewbranch andrewbranch merged commit af3e1d4 into microsoft:main Apr 8, 2022
@andrewbranch andrewbranch deleted the bug/47849 branch April 8, 2022 21:28
Jack-Works pushed a commit to Jack-Works/TypeScript that referenced this pull request Apr 22, 2022
…union with `undefined` (microsoft#48605)

* Reuse type nodes from optional parameters and properties even when not written as a union with `undefined`

* Remove newly unneeded NodeBuilderFlag

* Update public API

* Update baselines from main
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.

Declaration emit adds unnecessary import types
3 participants