Closed
Description
You could imagine that someone had the following:
var tuple: [string, number] = ["", 0];
var [a, ...b] = tuple;
Right now, a is string, but b is (string | number)[]
. This is because the type associated with b is the array of the element type of the incoming array.
But it would be really nice if b was [number]
, or at least number[]
. You should be able to chop off the rest of the elements in the incoming array, and only use those for the type associated with a rest element.