61 lines
2.2 KiB
Text
61 lines
2.2 KiB
Text
=== tests/cases/conformance/types/objectTypeLiteral/callSignatures/identicalCallSignatures.ts ===
|
|
// Each pair of call signatures in these types have a duplicate signature error.
|
|
// Identical call signatures should generate an error.
|
|
interface I {
|
|
>I : Symbol(I, Decl(identicalCallSignatures.ts, 0, 0))
|
|
|
|
(x): number;
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 3, 5))
|
|
|
|
(x: any): number;
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 4, 5))
|
|
|
|
<T>(x: T): T;
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5))
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 5, 8))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 5, 5))
|
|
|
|
<U>(x: U): U; // error
|
|
>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5))
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 6, 8))
|
|
>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5))
|
|
>U : Symbol(U, Decl(identicalCallSignatures.ts, 6, 5))
|
|
}
|
|
|
|
interface I2<T> {
|
|
>I2 : Symbol(I2, Decl(identicalCallSignatures.ts, 7, 1))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13))
|
|
|
|
(x: T): T;
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 10, 5))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13))
|
|
|
|
(x: T): T; // error
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 11, 5))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 9, 13))
|
|
}
|
|
|
|
var a: {
|
|
>a : Symbol(a, Decl(identicalCallSignatures.ts, 14, 3))
|
|
|
|
(x): number;
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 15, 5))
|
|
|
|
(x: any): number;
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 16, 5))
|
|
|
|
<T>(x: T): T;
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5))
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 17, 8))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 17, 5))
|
|
|
|
<T>(x: T): T; // error
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5))
|
|
>x : Symbol(x, Decl(identicalCallSignatures.ts, 18, 8))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5))
|
|
>T : Symbol(T, Decl(identicalCallSignatures.ts, 18, 5))
|
|
}
|