TypeScript/tests/cases/conformance/types/members/typesWithPrivateConstructor.ts

16 lines
No EOL
329 B
TypeScript

// @declaration: true
class C {
private constructor() { }
}
var c = new C(); // error C is private
var r: () => void = c.constructor;
class C2 {
private constructor(x: number);
private constructor(x: any) { }
}
var c2 = new C2(); // error C2 is private
var r2: (x: number) => void = c2.constructor;