2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(4,5): error TS1089: 'private' modifier cannot appear on a constructor declaration.
tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(11,5): error TS1089: 'private' modifier cannot appear on a constructor declaration.
tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(12,5): error TS1089: 'private' modifier cannot appear on a constructor declaration.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'.
2014-09-12 22:35:07 +02:00
tests/cases/conformance/types/members/typesWithPrivateConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/types/members/typesWithPrivateConstructor.ts (5 errors) ====
// private constructors are not allowed
class C {
private constructor() { }
~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS1089: 'private' modifier cannot appear on a constructor declaration.
2014-07-13 01:04:16 +02:00
}
var c = new C();
var r: () => void = c.constructor;
2014-07-19 02:30:06 +02:00
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'Function' is not assignable to type '() => void'.
2014-07-13 01:04:16 +02:00
class C2 {
private constructor(x: number);
~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS1089: 'private' modifier cannot appear on a constructor declaration.
2014-07-13 01:04:16 +02:00
private constructor(x: any) { }
~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS1089: 'private' modifier cannot appear on a constructor declaration.
2014-07-13 01:04:16 +02:00
}
var c2 = new C2();
~~~~~~~~
2014-09-12 00:19:57 +02:00
!!! error TS2346: Supplied parameters do not match any signature of call target.
2014-07-13 01:04:16 +02:00
var r2: (x: number) => void = c2.constructor;