Simple function with conditional type
The short a answer is you can’t. No value will be assignable to an unresolved conditional type (a conditional type that still depends on a free generic type variable). The only thing you can do is use a type assertion. function test<T extends boolean>(a: T): T extends true ? string : number { return (a … Read more