mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 00:23:10 +03:00
11 lines
288 B
TypeScript
11 lines
288 B
TypeScript
interface X {
|
|
a: string;
|
|
b: string;
|
|
}
|
|
|
|
declare function foo<T = X>(x: keyof T, y: keyof T): T;
|
|
declare function bar<T>(x: keyof T, y: keyof T): T;
|
|
|
|
const a = foo<X>('a', 'b'); // compiles cleanly
|
|
const b = foo('a', 'b'); // also clean
|
|
const c = bar('a', 'b'); // still clean
|