type A = { a: number }; type B = { b: number }; type X = ({ [K in keyof T]: T[K] } & Record)[keyof T]; type P1 = { data: X }; type P2 = { data: X }; interface I { fn(p1: P1>, p2: P2>): void; } const i: I = null as any; const p2: P2 = null as any; // Commenting out the below line will remove the error on the `const _i: I = i;` i.fn(null as any, p2); const _i: I = i;