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

19 lines
704 B
Text
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== 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.