Type is not assignable to conditional type
问题 I have a TypeScript code snippet in the playground. Please take a look there at TypeScript playground or here: enum MyTypes { FIRST = "FIRST", SECOND = "SECOND", THIRD = "THIRD" } type TFirst = { type: MyTypes.FIRST foo: string } type TSecond = { type: MyTypes.SECOND foo: string } type TThird = { type: MyTypes.THIRD bar: string } type TConditionalType<T> = T extends MyTypes.FIRST ? TFirst : T extends MyTypes.SECOND ? TSecond : T extends MyTypes.THIRD ? TThird : null const