I can't get a conditionnal type to work when used with a generic type
type TypeA = "a01" | "a02" | "a03" | "a04" | "a05" | "a06" | "a07" | "a08" | "a09" | "a10" | "a11";
type TypeB = "b01" | "b02" | "b03" | "b04" | "b05" | "b06";
type TypeC = "c01" | "c03" | "c04";
type Type = TypeA | TypeB | TypeC;
type Base<T extends Type = Type> = { type: T };
type Extended<T extends Type = Type> = T extends TypeB
? Base<T> & { extended: string }
: Base<T> /*& { extended?: never; }*/;
const toExtended = <T extends TypeA>(base: Base<T>): Extended<T> => base; // error: Type 'Base<T>' is not assignable to type 'Extended<T>'.(2322)
Here's the playground
I don't see the logical error here, as T extends TypeA, Extended<T> should extended<TypeA> which in fact is Base<TypeA> and the return type should be correct.
What am I doing wrong?