Skip to content

Preserve partially typed tuple names in more places - #55789

Merged
Jake Bailey (jakebailey) merged 5 commits into
microsoft:mainfrom
jakebailey:tuple-names
Oct 4, 2023
Merged

Preserve partially typed tuple names in more places#55789
Jake Bailey (jakebailey) merged 5 commits into
microsoft:mainfrom
jakebailey:tuple-names

Conversation

@jakebailey

Copy link
Copy Markdown
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).

>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
Copy Markdown
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
Copy Markdown
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
Jake Bailey (jakebailey) merged commit 579e494 into microsoft:main Oct 4, 2023
@jakebailey
Jake Bailey (jakebailey) deleted the tuple-names branch October 4, 2023 20:45
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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.

4 participants