Comment by dcre

6 hours ago

This made me realize TypeScript’s conditional types are closer to dependent types than I thought.

Yes. You can give pickType a type in TS. Something like pickType<B extends boolean>(b: B): B extends true ? string : number.

I’d love to read a post explaining how TS conditional types are or are not a form of dependent types. Or, I’d like to understand dependent types well enough to write that post.