Skip to content

Reuse more input nodes when they contain local type parameter references #56046

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

Closed
wants to merge 2 commits into from

Conversation

weswigham
Copy link
Member

Fixes #55575

Mostly, this just required adding local type parameters into the fake scopes we gin up during node building, and then ensuring type parameter node generation always went through the potentially-shadowed-type-parameter-name generation codepath (since we can no longer rely on their global accessibility to determine if their name is OK to use, since while it may be accessible via a fake scope, it might require a different name than it originally had due to shadowing).

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Oct 9, 2023
@jakebailey
Copy link
Member

This looks nearly the same as #55820, so maybe there was some issue duplication there? One thing that I realized that I needed was two fake scopes, since the same name can be both in type space and value space, but the scope can only hold one of them.

If you pull in my tests, do they work / fix the followup problem I discovered? I'm hoping there's a hybrid of the two PRs which avoids the pitfalls.

@jakebailey
Copy link
Member

It is surreal but very reassuring that we came up with effectively the same fix.

@jakebailey
Copy link
Member

I merged #55820; I didn't have it auto-close this PR though as I believe there some more reuse things in this PR that weren't covered in mine? (I know you're redoing more stuff anyhow so I'll leave it to you.)

@weswigham
Copy link
Member Author

We redid this (and actually merged it) recently as part of the node builder improvement work. 💖

@weswigham weswigham closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team Fix Available A PR has been opened for this issue 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.

Arrow function parameters using an alias and intersection are expanded inappropriately in .d.ts
3 participants