File: createArray.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,788 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
29
30
31
32
33
34
35
36
37
38
39
tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'.
tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'.
tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'.
tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.


==== tests/cases/compiler/createArray.ts (7 errors) ====
    var na=new number[];
               ~~~~~~
!!! error TS2304: Cannot find name 'number'.
                     ~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
    
    class C {
    }
    
    new C[];
         ~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
    var ba=new boolean[];
               ~~~~~~~
!!! error TS2304: Cannot find name 'boolean'.
                      ~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
    var sa=new string[];
               ~~~~~~
!!! error TS2304: Cannot find name 'string'.
                     ~~
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
    function f(s:string):number { return 0;
    }
    if (ba[14]) {
        na[2]=f(sa[3]);
    }
    
    new C[1]; // not an error