You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inferred subtuple types in extends expression not narrowed if variadic (i.e. has a rest element) #51138
Given the following behavior, which correctly narrows a subtuple:
One would expect similar narrowing when a tuple involves a rest element, but no narrowing occurs:
Fixing this bug would be useful as a non-recursive method of grabbing a subtuple of a predefined length, while also maintaining the subtuple's labels—which I think cannot be done today.
🔎 Search Terms
narrowing, tuple, extend, variadic
🕗 Version & Regression Information
Typescript 4.7, 4.8, and 4.9.0-dev.20221004
This is the behavior in every version I tried, and I reviewed the FAQ for entries about tuples (and labeled tuples), conditional types, type inference.
Activity