Skip to content

Inconsistent order in unions between tuple values #45144

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

Closed
pushkine opened this issue Jul 22, 2021 · 2 comments
Closed

Inconsistent order in unions between tuple values #45144

pushkine opened this issue Jul 22, 2021 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@pushkine
Copy link
Contributor

Bug Report

🕗 Version & Regression Information

ts stable & nightly

⏯ Playground Link

Playground Link

💻 Code

// The last comes first

type T1 = [1][any];             // 1
type T2 = [1, 2][any];          // 2 | 1
type T3 = [1, 2, 3][any];       // 3 | 1 | 2
type T4 = [1, 2, 3, 4][any];    // 4 | 1 | 2 | 3
type T5 = [1, 2, 3, 4, 5][any]; // 5 | 1 | 2 | 3 | 4

🙁 Actual behavior

In this snippet, a Tuple's last member always comes first in unions between its values

🙂 Expected behavior

type T2 = [1, 2, 3][any]; // 1 | 2 | 3
@MartinJohns
Copy link
Contributor

Essentially a duplicate of #17944.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jul 22, 2021
@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants