mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
93 lines
2.7 KiB
Plaintext
93 lines
2.7 KiB
Plaintext
//// [tests/cases/compiler/constructorsWithSpecializedSignatures.ts] ////
|
|
|
|
=== constructorsWithSpecializedSignatures.ts ===
|
|
// errors
|
|
declare class C {
|
|
>C : Symbol(C, Decl(constructorsWithSpecializedSignatures.ts, 0, 0))
|
|
|
|
constructor(x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 2, 16))
|
|
|
|
constructor(x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 3, 16))
|
|
|
|
constructor(x: number);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 4, 16))
|
|
}
|
|
|
|
// ok
|
|
declare class C2 {
|
|
>C2 : Symbol(C2, Decl(constructorsWithSpecializedSignatures.ts, 5, 1))
|
|
|
|
constructor(x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 9, 16))
|
|
|
|
constructor(x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 10, 16))
|
|
|
|
constructor(x: string);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 11, 16))
|
|
}
|
|
|
|
// errors
|
|
class D {
|
|
>D : Symbol(D, Decl(constructorsWithSpecializedSignatures.ts, 12, 1))
|
|
|
|
constructor(x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 16, 16))
|
|
|
|
constructor(x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 17, 16))
|
|
|
|
constructor(x: number);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 18, 16))
|
|
|
|
constructor(x: "hi") { }
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 19, 16))
|
|
}
|
|
|
|
// overloads are ok
|
|
class D2 {
|
|
>D2 : Symbol(D2, Decl(constructorsWithSpecializedSignatures.ts, 20, 1))
|
|
|
|
constructor(x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 24, 16))
|
|
|
|
constructor(x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 25, 16))
|
|
|
|
constructor(x: string);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 26, 16))
|
|
|
|
constructor(x: "hi") { } // error
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 27, 16))
|
|
}
|
|
|
|
// errors
|
|
interface I {
|
|
>I : Symbol(I, Decl(constructorsWithSpecializedSignatures.ts, 28, 1))
|
|
|
|
new (x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 32, 9))
|
|
|
|
new (x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 33, 9))
|
|
|
|
new (x: number);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 34, 9))
|
|
}
|
|
|
|
// ok
|
|
interface I2 {
|
|
>I2 : Symbol(I2, Decl(constructorsWithSpecializedSignatures.ts, 35, 1))
|
|
|
|
new (x: "hi");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 39, 9))
|
|
|
|
new (x: "foo");
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 40, 9))
|
|
|
|
new (x: string);
|
|
>x : Symbol(x, Decl(constructorsWithSpecializedSignatures.ts, 41, 9))
|
|
}
|