TypeScript/tests/baselines/reference/callOnInstance.errors.txt
2014-07-12 17:30:19 -07:00

19 lines
704 B
Plaintext

==== tests/cases/compiler/callOnInstance.ts (4 errors) ====
declare function D(): string;
declare class D { constructor (value: number); } // Duplicate identifier
~
!!! Duplicate identifier 'D'.
var s1: string = D(); // OK
var s2: string = (new D(1))();
~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
~~~~~~~~
!!! Only a void function can be called with the 'new' keyword.
declare class C { constructor(value: number); }
(new C(1))(); // Error for calling an instance
~~~~~~~~~~~~
!!! Cannot invoke an expression whose type lacks a call signature.