-
Notifications
You must be signed in to change notification settings - Fork 12.8k
variadic tuple types broken since 4.1.2 (same error as in 3.x.x) #41701
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
Comments
related: #41544 |
This is a correct error since the output type is absolutely not what you think it will be. The linked PR will make it not an error and make it do what you expect |
This issue has been marked 'Working as Intended' and has seen no recent activity. It has been automatically closed for house-keeping purposes. |
I ran into this today while experimenting with tuple types. If I understand correctly, this is exactly the case that was advertised as TypeScript 4.0's "variadic tuple types":
That example from the TypeScript 4.0 docs is working in 4.0 (Playground Link) and not working in 4.1 (Playground Link), so it does seem like a regression in 4.1 rather than "working as intended"? Or am I misunderstanding? |
TypeScript Version:
4.1.2 and newer
Search Terms:
rest elements, variadic tuple types
Code
Expected behavior:
It should compile as it does in 4.0.5
Actual behavior:
tsc fails with the following (3.x like) error message
Playground Link:
https://www.typescriptlang.org/play?ts=4.1.2#code/C4TwDgpgBAcgrgWwEYQE4GcoF4oDtEqoDaAugNwBQokUwE6w2URAdG-MmugDRQOoBLXAHNyQA
Related Issues:
The text was updated successfully, but these errors were encountered: