Why next code doesn't work? I assumed that intersection type A & B should match either A or B.
type Id = number | string;
type EntityType<T> = T & { id: Id };
const fn = <T>(a: EntityType<T>) => { }
const fn2 = <T>() => {
const f = fn<T>({ id: 5 }); // this line causes error
}
Link to reproduce: