27 lines
No EOL
1.1 KiB
Text
27 lines
No EOL
1.1 KiB
Text
tests/cases/conformance/types/members/typesWithPublicConstructor.ts(8,5): error TS2322: Type 'Function' is not assignable to type '() => void'.
|
|
Type 'Function' provides no match for the signature '(): void'
|
|
tests/cases/conformance/types/members/typesWithPublicConstructor.ts(15,10): error TS2346: Supplied parameters do not match any signature of call target.
|
|
|
|
|
|
==== tests/cases/conformance/types/members/typesWithPublicConstructor.ts (2 errors) ====
|
|
// public is allowed on a constructor but is not meaningful
|
|
|
|
class C {
|
|
public constructor() { }
|
|
}
|
|
|
|
var c = new C();
|
|
var r: () => void = c.constructor;
|
|
~
|
|
!!! error TS2322: Type 'Function' is not assignable to type '() => void'.
|
|
!!! error TS2322: Type 'Function' provides no match for the signature '(): void'
|
|
|
|
class C2 {
|
|
public constructor(x: number);
|
|
public constructor(x: any) { }
|
|
}
|
|
|
|
var c2 = new C2();
|
|
~~~~~~~~
|
|
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
|
var r2: (x: number) => void = c2.constructor; |