File: newWithSpread.errors.txt

package info (click to toggle)
node-typescript 4.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 396,552 kB
  • sloc: javascript: 1,444,377; makefile: 7; sh: 3
file content (177 lines) | stat: -rw-r--r-- 11,034 bytes parent folder | download | duplicates (4)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(36,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(37,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(40,8): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(41,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(45,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(46,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(50,15): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(51,15): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(55,17): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(56,17): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(60,18): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(61,18): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(65,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(66,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(70,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(71,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(75,20): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(76,20): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(80,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(81,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(85,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(86,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(90,27): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(91,27): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(95,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(96,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.


==== tests/cases/conformance/expressions/functionCalls/newWithSpread.ts (26 errors) ====
    function f(x: number, y: number, ...z: string[]) {
    }
    
    function f2(...x: string[]) {
    }
    
    interface A {
        f: {
            new (x: number, y: number, ...z: string[]);
        }
    }
    
    class B {
        constructor(x: number, y: number, ...z: string[]) {}
    }
    
    interface C {
        "a-b": typeof B;
    }
    
    interface D {
        1: typeof B;
    }
    
    var a: string[];
    var b: A;
    var c: C;
    var d: A[];
    var e: { [key: string]: A };
    var g: C[];
    var h: { [key: string]: C };
    var i: C[][];
    
    // Basic expression
    new f(1, 2, "string");
    new f(1, 2, ...a);
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new f(1, 2, ...a, "string");
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Multiple spreads arguments
    new f2(...a, ...a);
           ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new f(1 ,2, ...a, ...a);
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Call expression
    new f(1, 2, "string")();
    new f(1, 2, ...a)();
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new f(1, 2, ...a, "string")();
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Property access expression
    new b.f(1, 2, "string");
    new b.f(1, 2, ...a);
                  ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new b.f(1, 2, ...a, "string"); 
                  ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Parenthesised expression
    new (b.f)(1, 2, "string");
    new (b.f)(1, 2, ...a);
                    ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new (b.f)(1, 2, ...a, "string"); 
                    ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Element access expression
    new d[1].f(1, 2, "string");
    new d[1].f(1, 2, ...a);
                     ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new d[1].f(1, 2, ...a, "string");
                     ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Element access expression with a punctuated key
    new e["a-b"].f(1, 2, "string");
    new e["a-b"].f(1, 2, ...a);
                         ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new e["a-b"].f(1, 2, ...a, "string");
                         ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Basic expression
    new B(1, 2, "string");
    new B(1, 2, ...a);
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new B(1, 2, ...a, "string");
                ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Property access expression
    new c["a-b"](1, 2, "string");
    new c["a-b"](1, 2, ...a);
                       ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new c["a-b"](1, 2, ...a, "string");
                       ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Parenthesised expression
    new (c["a-b"])(1, 2, "string");
    new (c["a-b"])(1, 2, ...a);
                         ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new (c["a-b"])(1, 2, ...a, "string");
                         ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Element access expression
    new g[1]["a-b"](1, 2, "string");
    new g[1]["a-b"](1, 2, ...a);
                          ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new g[1]["a-b"](1, 2, ...a, "string");
                          ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Element access expression with a punctuated key
    new h["a-b"]["a-b"](1, 2, "string");
    new h["a-b"]["a-b"](1, 2, ...a);
                              ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new h["a-b"]["a-b"](1, 2, ...a, "string");
                              ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    
    // Element access expression with a number
    new i["a-b"][1](1, 2, "string");
    new i["a-b"][1](1, 2, ...a);
                          ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
    new i["a-b"][1](1, 2, ...a, "string");
                          ~~~~
!!! error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.