David Blass @ssalbdivad.dev · Nov 13

Conditional types *kind of* work like this by default depending on the situation. All the edge cases make implicit distribution really unintuitive and you end up wanting to opt-out fairly often with the tuple wrapping trick, i.e. `[t] extends [string]`.

1 likes 3 replies

?

Replies

Tom Hicks · Nov 13

T over Value extends string ? … Not sure if it’s correct but I always read distribution as “over”

David Blass · Nov 13

Whoops, this should have included the hover for the second result ^^

David Blass · Nov 13

Way too late to change it now, but I really wish if you wanted your conditional type to distribute, there were a dedicated keyword similar to what you mention like `t of value extends string ? t : never`. Another case of explicit > implicit.