swc/crates/swc_ecma_parser/tests/tsc/identicalCallSignatures.ts

20 lines
391 B
TypeScript
Raw Normal View History

// Each pair of call signatures in these types have a duplicate signature error.
// Identical call signatures should generate an error.
interface I {
(x): number;
(x: any): number;
<T>(x: T): T;
<U>(x: U): U; // error
}
interface I2<T> {
(x: T): T;
(x: T): T; // error
}
var a: {
(x): number;
(x: any): number;
<T>(x: T): T;
<T>(x: T): T; // error
}