178 lines
11 KiB
Plaintext
178 lines
11 KiB
Plaintext
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(38,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(41,8): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(42,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(47,13): 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(52,15): 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(57,17): 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(62,18): 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(67,22): 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(72,13): 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(77,20): 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(82,22): 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(87,23): 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(92,27): 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(97,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. |