File: callOnInstance.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1~bpo8%2B1
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 203,960 kB
  • sloc: sh: 11; makefile: 5
file content (28 lines) | stat: -rw-r--r-- 1,457 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier 'D'.
tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2346: Supplied parameters do not match any signature of call target.
tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.


==== tests/cases/compiler/callOnInstance.ts (5 errors) ====
    declare function D(): string; // error
                     ~
!!! error TS2300: Duplicate identifier 'D'.
    
    declare class D { constructor (value: number); } // error
                  ~
!!! error TS2300: Duplicate identifier 'D'.
    
    var s1: string = D(); // OK
    
    var s2: string = (new D(1))();
                      ~~~~~~~~
!!! error TS2346: Supplied parameters do not match any signature of call target.
                      ~~~~~~~~
!!! error TS2350: 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
    ~~~~~~~~~~~~
!!! error TS2349: Cannot invoke an expression whose type lacks a call signature. Type 'C' has no compatible call signatures.