1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
=== tests/cases/conformance/types/members/typesWithPrivateConstructor.ts ===
class C {
>C : Symbol(C, Decl(typesWithPrivateConstructor.ts, 0, 0))
private constructor() { }
}
var c = new C(); // error C is private
>c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3))
>C : Symbol(C, Decl(typesWithPrivateConstructor.ts, 0, 0))
var r: () => void = c.constructor;
>r : Symbol(r, Decl(typesWithPrivateConstructor.ts, 5, 3))
>c : Symbol(c, Decl(typesWithPrivateConstructor.ts, 4, 3))
class C2 {
>C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34))
private constructor(x: number);
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 8, 24))
private constructor(x: any) { }
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 9, 24))
}
var c2 = new C2(); // error C2 is private
>c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3))
>C2 : Symbol(C2, Decl(typesWithPrivateConstructor.ts, 5, 34))
var r2: (x: number) => void = c2.constructor;
>r2 : Symbol(r2, Decl(typesWithPrivateConstructor.ts, 13, 3))
>x : Symbol(x, Decl(typesWithPrivateConstructor.ts, 13, 9))
>c2 : Symbol(c2, Decl(typesWithPrivateConstructor.ts, 12, 3))
|