Skip to content

Preserve partially typed tuple names in more places #55789

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 5 commits into from
Oct 4, 2023

Conversation

jakebailey
Copy link
Member

#53356 introduced the ability to have partially named tuples, but while working on another bug, I noticed that there were a few places that the PR missed that should also be preserving names. This fixes those cases, with tests.

There are still other calls to createTupleType which are missing names, but they all appear to be unable to generate them (anywhere that generates a tuple from a binding, or are "noramlizing" a tuple which can create more than one element for the same name).

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Sep 19, 2023
@@ -265,8 +265,8 @@ f3((a, b, c) => {})
f3((...x) => {})
>f3((...x) => {}) : void
>f3 : (cb: (x: number, args_0: boolean, ...args_1: string[]) => void) => void
>(...x) => {} : (x_0: number, x_1: boolean, ...x_2: string[]) => void
>x : [number, boolean, ...string[]]
>(...x) => {} : (x: number, x_1: boolean, ...x_2: string[]) => void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is a little funky - x isn;t consistent with x_1, but not a dealbreaker.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

x is just the name given in the original type, the rest are generated.

@jakebailey jakebailey merged commit 579e494 into microsoft:main Oct 4, 2023
@jakebailey jakebailey deleted the tuple-names branch October 4, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants