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
Mapped Type [Lhs of Rhs] Syntax for Array and Tuple TypesΒ #54575
typeBar=Fooextends infer T ? {[KinkeyofT]: T[K][]} : never
Both workarounds are not immediately obvious to inexperienced developers, less ergonomic, and will silently break when Foo is no longer an array or tuple type without putting extra constraints.
Presumably if #27995 were fixed we wouldn't need such a feature? Is there a reason we'd want this feature instead of fixing #27995?
I would say both the fix and this feature can co-exist, as the second (ergonomics) and third (enforcing rhs must extend readonly unknown[]) points this feature provides are still valuable.
Activity
jcalz commentedon Jun 8, 2023
Presumably if #27995 were fixed we wouldn't need such a feature? Is there a reason we'd want this feature instead of fixing #27995?
NonSpicyBurrito commentedon Jun 8, 2023
I would say both the fix and this feature can co-exist, as the second (ergonomics) and third (enforcing rhs must extend
readonly unknown[]) points this feature provides are still valuable.