Tuple suffix associated with rest element in a binding pattern #2714
Labels
By Design
Deprecated - use "Working as Intended" or "Design Limitation" instead
Suggestion
An idea for TypeScript
You could imagine that someone had the following:
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 leastnumber[]
. 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.The text was updated successfully, but these errors were encountered: