File: arrayTypeOfFunctionTypes.errors.txt

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (25 lines) | stat: -rw-r--r-- 1,023 bytes parent folder | download | duplicates (7)
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
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts(11,11): error TS2350: Only a void function can be called with the 'new' keyword.
tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts(16,11): error TS2350: Only a void function can be called with the 'new' keyword.


==== tests/cases/conformance/types/specifyingTypes/typeLiterals/arrayTypeOfFunctionTypes.ts (2 errors) ====
    // valid uses of arrays of function types
    
    var x: () => string[];
    var r = x[1];
    var r2 = r();
    var r2b = new r();
    
    var x2: { (): string }[];
    var r3 = x2[1];
    var r4 = r3();
    var r4b = new r3(); // error
              ~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.
    
    var x3: Array<() => string>;
    var r5 = x2[1];
    var r6 = r5();
    var r6b = new r5(); // error
              ~~~~~~~~
!!! error TS2350: Only a void function can be called with the 'new' keyword.