-
-
Notifications
You must be signed in to change notification settings - Fork 548
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
UnionToTuple fails when tuple is not ordered #955
Comments
See description in #945. Due to the limitations of typescript, it is currently not possible to generate ordered arrays, which we state in the documentation. |
@Emiyaaaaa, I saw the notes in the test and in the docs, I found it confusing, however, because they say |
If your confuse is about the type name, this info in #945 may can help you. |
Thanks @Emiyaaaaa. I think my confusion comes in because the docs state these are "unordered" arrays, in fact, there's even this test:
The issue I'm running into is that this test is actually not valid and should be failing. Note, if you do In short, the docs say "Convert a union type into an unordered tuple type of its elements" but it seems the docs should instead say "Convert a union type into an ordered tuple type of its elements". |
UnionToTuple is requiring a specific order.
As a result, I get errors when I want to create an exhaustive array of an object's properties:
This makes it particularly hard to use if the Obj type was, itself, dynamically created as it results in an intermittent type failure no matter what order I put the keys in.
Upvote & Fund
The text was updated successfully, but these errors were encountered: