Closed
Description
TypeScript Version:
4.1.2 and newer
Search Terms:
rest elements, variadic tuple types
Code
type Numbers = number[];
type test = [...Numbers, string];
Expected behavior:
It should compile as it does in 4.0.5
Actual behavior:
tsc fails with the following (3.x like) error message
A rest element must be last in a tuple type.
Playground Link:
https://www.typescriptlang.org/play?ts=4.1.2#code/C4TwDgpgBAcgrgWwEYQE4GcoF4oDtEqoDaAugNwBQokUwE6w2URAdG-MmugDRQOoBLXAHNyQA
Related Issues: