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
I've noticed that when using the spread operator with as const variables, TypeScript loses tuples' index-to-type information, contrary to object literals, which get their structure (key-to-type) copied over:
Search Terms
spread tuple const assertion
Suggestion
I've noticed that when using the spread operator with
as const
variables, TypeScript loses tuples' index-to-type information, contrary to object literals, which get their structure (key-to-type) copied over:(reproduction link)
Is this due to the same underlying issue present in #34589?
Use Cases
This would allow us to "extend" tuple types
Examples
(reproduction link)
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: