19 lines
No EOL
704 B
Text
19 lines
No EOL
704 B
Text
==== 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. |