-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Improve reuse of nodes in signatures with type mapping #58546
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
Improve reuse of nodes in signatures with type mapping #58546
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the user tests comparing Something interesting changed - please have a look. Details
|
@jakebailey Here are the results of running the top 400 repos comparing Something interesting changed - please have a look. Details
|
…arations-mapped-sig-reuse
Used your tool to review all 201 significantly changed files. Some notes: These are examples of notably good changes (good enough to point out how good they are):
Most changes seem like just good reuse updates, so that's good. Most of the other changes seem to be a couple of categories:
Other stuff:
|
|
Ah, right. I've wanted to make hover pass that flag, honestly. (related, #55821)
We've iterated on the type parameter renaming code so much that I'm not sure why it doesn't work, honestly. I definitely had fixed some cases like this before, but we undid some of that, then redid some of that. So it does sound like an improvement, but that may be challenging because even though we introduce a new name |
It's a bit more pessimistic than it strictly has to be sometimes, but the renaming in general is needed because cases like this export const a = <T,>() => {
type U = T;
return <T extends U>() => null as any as T;
} exist. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm gonna merge this at this point so we have more time to work on top of it - I like the approach and the changes on the whole look good, and I think that if it doesn't fix some other issues reported with the new node reuse we're doing, it's a required stepping stone for them.
Improve reuse of nodes in signatures with type mapping