type-level-typescript-workshop icon indicating copy to clipboard operation
type-level-typescript-workshop copied to clipboard

ex. 02-7, nonoptimal hint and solution

Open JohnGurin opened this issue 2 years ago • 0 comments

type XOR<bool1, bool2> = TODO

https://github.com/gvergnaud/type-level-typescript-workshop/blob/a2234bea76dbbc4b97c074e1b1c40e08f6c7529e/02-assignability-and-conditional-types/exercises.ts#L140

https://github.com/gvergnaud/type-level-typescript-workshop/blob/a2234bea76dbbc4b97c074e1b1c40e08f6c7529e/02-assignability-and-conditional-types/solution.ts#L131

alternative solution
type XOR<bool1, bool2> = bool1 extends bool2? false: true;

JohnGurin avatar Sep 11 '22 20:09 JohnGurin