TypeScript/tests/baselines/reference/typesWithPrivateConstructor.errors.txt

27 lines
875 B
Plaintext

==== tests/cases/conformance/types/members/typesWithPrivateConstructor.ts (5 errors) ====
// private constructors are not allowed
class C {
private constructor() { }
~~~~~~~
!!! 'private' modifier cannot appear on a constructor declaration.
}
var c = new C();
var r: () => void = c.constructor;
~
!!! Type 'Function' is not assignable to type '() => void'.
class C2 {
private constructor(x: number);
~~~~~~~
!!! 'private' modifier cannot appear on a constructor declaration.
private constructor(x: any) { }
~~~~~~~
!!! 'private' modifier cannot appear on a constructor declaration.
}
var c2 = new C2();
~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
var r2: (x: number) => void = c2.constructor;