interface X { a: string; b: string; } declare function foo(x: keyof T, y: keyof T): T; declare function bar(x: keyof T, y: keyof T): T; const a = foo('a', 'b'); // compiles cleanly const b = foo('a', 'b'); // also clean const c = bar('a', 'b'); // still clean