Skip to content
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

feat(16656): as tuple type assertion #51463

Closed
wants to merge 1 commit into from

Conversation

graphemecluster
Copy link
Contributor

Fix #16656
Fix #27179
Fix #29163
Fix #48052
Fix #49414

@typescript-bot
Copy link
Collaborator

The TypeScript team hasn't accepted the linked issue #16656. If you can get it accepted, this PR will have a better chance of being reviewed.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 9, 2022
@Jack-Works
Copy link
Contributor

I expect tuple used as the primitive type for tc39 proposal https://github.com/tc39/proposal-record-tuple

@graphemecluster
Copy link
Contributor Author

@Jack-Works Yea but I can’t think of a word better than this. After all, at least for the time being, the term tuple is used exclusively to mean array with length boundary or mixed types in the current TypeScript codebase.

And there are actually no conflicts at all:

const a = ["foo", 42, true] as tuple; // [string, number, boolean]
const b = #["foo", 42, true]; // ESTuple<["foo", 42, true]>

@jakebailey
Copy link
Member

There's no conflict as of now, but if tuple is defined as a primitive type, it would need to be able to be written in type assertions like foo as unknown as tuple, and that is definitely a conflict.

@graphemecluster
Copy link
Contributor Author

@jakebailey But I guess you need some type parameters for the tuple type right?

… Anyway I’d like to ask what keyword would the Team prefer then?

@sandersn
Copy link
Member

sandersn commented Dec 2, 2022

To help with PR housekeeping, I'm going to close this PR since there's still design work to be done on the original issue.

@sandersn sandersn closed this Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Archived in project
5 participants