mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 21:36:50 -05:00
Adds tests
This commit is contained in:
165
tests/baselines/reference/newWithSpread.errors.txt
Normal file
165
tests/baselines/reference/newWithSpread.errors.txt
Normal file
@@ -0,0 +1,165 @@
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(34,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(35,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(39,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,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(44,15): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(45,15): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(49,17): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(50,17): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(54,18): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(55,18): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(59,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(60,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(64,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(65,13): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(69,20): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(70,20): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(74,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(75,22): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(79,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(80,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(84,27): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(85,27): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/conformance/expressions/functionCalls/newWithSpread.ts(89,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,23): error TS2472: Spread operator in 'new' expressions is only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/functionCalls/newWithSpread.ts (24 errors) ====
|
||||
|
||||
function f(x: number, y: number, ...z: 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.
|
||||
|
||||
// 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.
|
||||
164
tests/baselines/reference/newWithSpread.js
Normal file
164
tests/baselines/reference/newWithSpread.js
Normal file
@@ -0,0 +1,164 @@
|
||||
//// [newWithSpread.ts]
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
|
||||
//// [newWithSpread.js]
|
||||
function f(x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
var B = (function () {
|
||||
function B(x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
var d;
|
||||
var e;
|
||||
var g;
|
||||
var h;
|
||||
var i;
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
new f(1, 2, ...a);
|
||||
new f(1, 2, ...a, "string");
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
164
tests/baselines/reference/newWithSpreadES5.js
Normal file
164
tests/baselines/reference/newWithSpreadES5.js
Normal file
@@ -0,0 +1,164 @@
|
||||
//// [newWithSpreadES5.ts]
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
|
||||
//// [newWithSpreadES5.js]
|
||||
function f(x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
var B = (function () {
|
||||
function B(x, y) {
|
||||
var z = [];
|
||||
for (var _i = 2; _i < arguments.length; _i++) {
|
||||
z[_i - 2] = arguments[_i];
|
||||
}
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
var d;
|
||||
var e;
|
||||
var g;
|
||||
var h;
|
||||
var i;
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a))))();
|
||||
new (Function.bind.apply(f, [void 0].concat([1, 2].concat(a, ["string"]))))();
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new (Function.bind.apply(b.f, [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(b.f, [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (Function.bind.apply((b.f), [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply((b.f), [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new (Function.bind.apply(d[1].f, [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(d[1].f, [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new (Function.bind.apply(e["a-b"].f, [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(e["a-b"].f, [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new (Function.bind.apply(B, [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(B, [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new (Function.bind.apply(c["a-b"], [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(c["a-b"], [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (Function.bind.apply((c["a-b"]), [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply((c["a-b"]), [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new (Function.bind.apply(g[1]["a-b"], [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(g[1]["a-b"], [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Element access expression with a punctuated key
|
||||
new h["a-b"]["a-b"](1, 2, "string");
|
||||
new (Function.bind.apply(h["a-b"]["a-b"], [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(h["a-b"]["a-b"], [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new (Function.bind.apply(i["a-b"][1], [void 0].concat([1, 2].concat(a))));
|
||||
new (Function.bind.apply(i["a-b"][1], [void 0].concat([1, 2].concat(a, ["string"]))));
|
||||
258
tests/baselines/reference/newWithSpreadES5.symbols
Normal file
258
tests/baselines/reference/newWithSpreadES5.symbols
Normal file
@@ -0,0 +1,258 @@
|
||||
=== tests/cases/conformance/expressions/functionCalls/newWithSpreadES5.ts ===
|
||||
|
||||
function f(x: number, y: number, ...z: string[]) {
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(newWithSpreadES5.ts, 1, 11))
|
||||
>y : Symbol(y, Decl(newWithSpreadES5.ts, 1, 21))
|
||||
>z : Symbol(z, Decl(newWithSpreadES5.ts, 1, 32))
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(newWithSpreadES5.ts, 2, 1))
|
||||
|
||||
f: {
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
|
||||
new (x: number, y: number, ...z: string[]);
|
||||
>x : Symbol(x, Decl(newWithSpreadES5.ts, 6, 13))
|
||||
>y : Symbol(y, Decl(newWithSpreadES5.ts, 6, 23))
|
||||
>z : Symbol(z, Decl(newWithSpreadES5.ts, 6, 34))
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
|
||||
constructor(x: number, y: number, ...z: string[]) {}
|
||||
>x : Symbol(x, Decl(newWithSpreadES5.ts, 11, 16))
|
||||
>y : Symbol(y, Decl(newWithSpreadES5.ts, 11, 26))
|
||||
>z : Symbol(z, Decl(newWithSpreadES5.ts, 11, 37))
|
||||
}
|
||||
|
||||
interface C {
|
||||
>C : Symbol(C, Decl(newWithSpreadES5.ts, 12, 1))
|
||||
|
||||
"a-b": typeof B;
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
}
|
||||
|
||||
interface D {
|
||||
>D : Symbol(D, Decl(newWithSpreadES5.ts, 16, 1))
|
||||
|
||||
1: typeof B;
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
}
|
||||
|
||||
var a: string[];
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
var b: A;
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>A : Symbol(A, Decl(newWithSpreadES5.ts, 2, 1))
|
||||
|
||||
var c: C;
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES5.ts, 12, 1))
|
||||
|
||||
var d: A[];
|
||||
>d : Symbol(d, Decl(newWithSpreadES5.ts, 25, 3))
|
||||
>A : Symbol(A, Decl(newWithSpreadES5.ts, 2, 1))
|
||||
|
||||
var e: { [key: string]: A };
|
||||
>e : Symbol(e, Decl(newWithSpreadES5.ts, 26, 3))
|
||||
>key : Symbol(key, Decl(newWithSpreadES5.ts, 26, 10))
|
||||
>A : Symbol(A, Decl(newWithSpreadES5.ts, 2, 1))
|
||||
|
||||
var g: C[];
|
||||
>g : Symbol(g, Decl(newWithSpreadES5.ts, 27, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES5.ts, 12, 1))
|
||||
|
||||
var h: { [key: string]: C };
|
||||
>h : Symbol(h, Decl(newWithSpreadES5.ts, 28, 3))
|
||||
>key : Symbol(key, Decl(newWithSpreadES5.ts, 28, 10))
|
||||
>C : Symbol(C, Decl(newWithSpreadES5.ts, 12, 1))
|
||||
|
||||
var i: C[][];
|
||||
>i : Symbol(i, Decl(newWithSpreadES5.ts, 29, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES5.ts, 12, 1))
|
||||
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
|
||||
new f(1, 2, ...a);
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new f(1, 2, ...a, "string");
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
|
||||
new f(1, 2, ...a)();
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new f(1, 2, ...a, "string")();
|
||||
>f : Symbol(f, Decl(newWithSpreadES5.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
|
||||
new b.f(1, 2, ...a);
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new b.f(1, 2, ...a, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
|
||||
new (b.f)(1, 2, ...a);
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES5.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES5.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
|
||||
new d[1].f(1, 2, ...a);
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES5.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES5.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES5.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES5.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES5.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES5.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
|
||||
new B(1, 2, ...a);
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new B(1, 2, ...a, "string");
|
||||
>B : Symbol(B, Decl(newWithSpreadES5.ts, 8, 1))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
|
||||
new c["a-b"](1, 2, ...a);
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES5.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
>g : Symbol(g, Decl(newWithSpreadES5.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
>g : Symbol(g, Decl(newWithSpreadES5.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
>g : Symbol(g, Decl(newWithSpreadES5.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new h["a-b"]["a-b"](1, 2, "string");
|
||||
>h : Symbol(h, Decl(newWithSpreadES5.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a);
|
||||
>h : Symbol(h, Decl(newWithSpreadES5.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
>h : Symbol(h, Decl(newWithSpreadES5.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES5.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
>i : Symbol(i, Decl(newWithSpreadES5.ts, 29, 3))
|
||||
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
>i : Symbol(i, Decl(newWithSpreadES5.ts, 29, 3))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
>i : Symbol(i, Decl(newWithSpreadES5.ts, 29, 3))
|
||||
>a : Symbol(a, Decl(newWithSpreadES5.ts, 22, 3))
|
||||
|
||||
471
tests/baselines/reference/newWithSpreadES5.types
Normal file
471
tests/baselines/reference/newWithSpreadES5.types
Normal file
@@ -0,0 +1,471 @@
|
||||
=== tests/cases/conformance/expressions/functionCalls/newWithSpreadES5.ts ===
|
||||
|
||||
function f(x: number, y: number, ...z: string[]) {
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
f: {
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
|
||||
new (x: number, y: number, ...z: string[]);
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : B
|
||||
|
||||
constructor(x: number, y: number, ...z: string[]) {}
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
|
||||
interface C {
|
||||
>C : C
|
||||
|
||||
"a-b": typeof B;
|
||||
>B : typeof B
|
||||
}
|
||||
|
||||
interface D {
|
||||
>D : D
|
||||
|
||||
1: typeof B;
|
||||
>B : typeof B
|
||||
}
|
||||
|
||||
var a: string[];
|
||||
>a : string[]
|
||||
|
||||
var b: A;
|
||||
>b : A
|
||||
>A : A
|
||||
|
||||
var c: C;
|
||||
>c : C
|
||||
>C : C
|
||||
|
||||
var d: A[];
|
||||
>d : A[]
|
||||
>A : A
|
||||
|
||||
var e: { [key: string]: A };
|
||||
>e : { [key: string]: A; }
|
||||
>key : string
|
||||
>A : A
|
||||
|
||||
var g: C[];
|
||||
>g : C[]
|
||||
>C : C
|
||||
|
||||
var h: { [key: string]: C };
|
||||
>h : { [key: string]: C; }
|
||||
>key : string
|
||||
>C : C
|
||||
|
||||
var i: C[][];
|
||||
>i : C[][]
|
||||
>C : C
|
||||
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
>new f(1, 2, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new f(1, 2, ...a);
|
||||
>new f(1, 2, ...a) : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new f(1, 2, ...a, "string");
|
||||
>new f(1, 2, ...a, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
>new f(1, 2, "string")() : any
|
||||
>new f(1, 2, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new f(1, 2, ...a)();
|
||||
>new f(1, 2, ...a)() : any
|
||||
>new f(1, 2, ...a) : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new f(1, 2, ...a, "string")();
|
||||
>new f(1, 2, ...a, "string")() : any
|
||||
>new f(1, 2, ...a, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
>new b.f(1, 2, "string") : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new b.f(1, 2, ...a);
|
||||
>new b.f(1, 2, ...a) : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new b.f(1, 2, ...a, "string");
|
||||
>new b.f(1, 2, ...a, "string") : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
>new (b.f)(1, 2, "string") : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new (b.f)(1, 2, ...a);
|
||||
>new (b.f)(1, 2, ...a) : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
>new (b.f)(1, 2, ...a, "string") : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
>new d[1].f(1, 2, "string") : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new d[1].f(1, 2, ...a);
|
||||
>new d[1].f(1, 2, ...a) : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
>new d[1].f(1, 2, ...a, "string") : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
>new e["a-b"].f(1, 2, "string") : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
>new e["a-b"].f(1, 2, ...a) : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
>new e["a-b"].f(1, 2, ...a, "string") : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
>new B(1, 2, "string") : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new B(1, 2, ...a);
|
||||
>new B(1, 2, ...a) : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new B(1, 2, ...a, "string");
|
||||
>new B(1, 2, ...a, "string") : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
>new c["a-b"](1, 2, "string") : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new c["a-b"](1, 2, ...a);
|
||||
>new c["a-b"](1, 2, ...a) : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
>new c["a-b"](1, 2, ...a, "string") : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
>new (c["a-b"])(1, 2, "string") : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
>new (c["a-b"])(1, 2, ...a) : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
>new (c["a-b"])(1, 2, ...a, "string") : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
>new g[1]["a-b"](1, 2, "string") : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
>new g[1]["a-b"](1, 2, ...a) : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
>new g[1]["a-b"](1, 2, ...a, "string") : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new h["a-b"]["a-b"](1, 2, "string");
|
||||
>new h["a-b"]["a-b"](1, 2, "string") : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a);
|
||||
>new h["a-b"]["a-b"](1, 2, ...a) : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
>new h["a-b"]["a-b"](1, 2, ...a, "string") : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
>new i["a-b"][1](1, 2, "string") : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
>new i["a-b"][1](1, 2, ...a) : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
>new i["a-b"][1](1, 2, ...a, "string") : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
155
tests/baselines/reference/newWithSpreadES6.js
Normal file
155
tests/baselines/reference/newWithSpreadES6.js
Normal file
@@ -0,0 +1,155 @@
|
||||
//// [newWithSpreadES6.ts]
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
|
||||
//// [newWithSpreadES6.js]
|
||||
function f(x, y, ...z) {
|
||||
}
|
||||
class B {
|
||||
constructor(x, y, ...z) {
|
||||
}
|
||||
}
|
||||
var a;
|
||||
var b;
|
||||
var c;
|
||||
var d;
|
||||
var e;
|
||||
var g;
|
||||
var h;
|
||||
var i;
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
new f(1, 2, ...a);
|
||||
new f(1, 2, ...a, "string");
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
258
tests/baselines/reference/newWithSpreadES6.symbols
Normal file
258
tests/baselines/reference/newWithSpreadES6.symbols
Normal file
@@ -0,0 +1,258 @@
|
||||
=== tests/cases/conformance/expressions/functionCalls/newWithSpreadES6.ts ===
|
||||
|
||||
function f(x: number, y: number, ...z: string[]) {
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(newWithSpreadES6.ts, 1, 11))
|
||||
>y : Symbol(y, Decl(newWithSpreadES6.ts, 1, 21))
|
||||
>z : Symbol(z, Decl(newWithSpreadES6.ts, 1, 32))
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : Symbol(A, Decl(newWithSpreadES6.ts, 2, 1))
|
||||
|
||||
f: {
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
|
||||
new (x: number, y: number, ...z: string[]);
|
||||
>x : Symbol(x, Decl(newWithSpreadES6.ts, 6, 13))
|
||||
>y : Symbol(y, Decl(newWithSpreadES6.ts, 6, 23))
|
||||
>z : Symbol(z, Decl(newWithSpreadES6.ts, 6, 34))
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
|
||||
constructor(x: number, y: number, ...z: string[]) {}
|
||||
>x : Symbol(x, Decl(newWithSpreadES6.ts, 11, 16))
|
||||
>y : Symbol(y, Decl(newWithSpreadES6.ts, 11, 26))
|
||||
>z : Symbol(z, Decl(newWithSpreadES6.ts, 11, 37))
|
||||
}
|
||||
|
||||
interface C {
|
||||
>C : Symbol(C, Decl(newWithSpreadES6.ts, 12, 1))
|
||||
|
||||
"a-b": typeof B;
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
}
|
||||
|
||||
interface D {
|
||||
>D : Symbol(D, Decl(newWithSpreadES6.ts, 16, 1))
|
||||
|
||||
1: typeof B;
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
}
|
||||
|
||||
var a: string[];
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
var b: A;
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>A : Symbol(A, Decl(newWithSpreadES6.ts, 2, 1))
|
||||
|
||||
var c: C;
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES6.ts, 12, 1))
|
||||
|
||||
var d: A[];
|
||||
>d : Symbol(d, Decl(newWithSpreadES6.ts, 25, 3))
|
||||
>A : Symbol(A, Decl(newWithSpreadES6.ts, 2, 1))
|
||||
|
||||
var e: { [key: string]: A };
|
||||
>e : Symbol(e, Decl(newWithSpreadES6.ts, 26, 3))
|
||||
>key : Symbol(key, Decl(newWithSpreadES6.ts, 26, 10))
|
||||
>A : Symbol(A, Decl(newWithSpreadES6.ts, 2, 1))
|
||||
|
||||
var g: C[];
|
||||
>g : Symbol(g, Decl(newWithSpreadES6.ts, 27, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES6.ts, 12, 1))
|
||||
|
||||
var h: { [key: string]: C };
|
||||
>h : Symbol(h, Decl(newWithSpreadES6.ts, 28, 3))
|
||||
>key : Symbol(key, Decl(newWithSpreadES6.ts, 28, 10))
|
||||
>C : Symbol(C, Decl(newWithSpreadES6.ts, 12, 1))
|
||||
|
||||
var i: C[][];
|
||||
>i : Symbol(i, Decl(newWithSpreadES6.ts, 29, 3))
|
||||
>C : Symbol(C, Decl(newWithSpreadES6.ts, 12, 1))
|
||||
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
|
||||
new f(1, 2, ...a);
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new f(1, 2, ...a, "string");
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
|
||||
new f(1, 2, ...a)();
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new f(1, 2, ...a, "string")();
|
||||
>f : Symbol(f, Decl(newWithSpreadES6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
|
||||
new b.f(1, 2, ...a);
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new b.f(1, 2, ...a, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
|
||||
new (b.f)(1, 2, ...a);
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
>b.f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>b : Symbol(b, Decl(newWithSpreadES6.ts, 23, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES6.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
|
||||
new d[1].f(1, 2, ...a);
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES6.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
>d[1].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>d : Symbol(d, Decl(newWithSpreadES6.ts, 25, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES6.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES6.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
>e["a-b"].f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>e : Symbol(e, Decl(newWithSpreadES6.ts, 26, 3))
|
||||
>f : Symbol(A.f, Decl(newWithSpreadES6.ts, 4, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
|
||||
new B(1, 2, ...a);
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new B(1, 2, ...a, "string");
|
||||
>B : Symbol(B, Decl(newWithSpreadES6.ts, 8, 1))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
|
||||
new c["a-b"](1, 2, ...a);
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
>c : Symbol(c, Decl(newWithSpreadES6.ts, 24, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
>g : Symbol(g, Decl(newWithSpreadES6.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
>g : Symbol(g, Decl(newWithSpreadES6.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
>g : Symbol(g, Decl(newWithSpreadES6.ts, 27, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new h["a-b"]["a-b"](1, 2, "string");
|
||||
>h : Symbol(h, Decl(newWithSpreadES6.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a);
|
||||
>h : Symbol(h, Decl(newWithSpreadES6.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
>h : Symbol(h, Decl(newWithSpreadES6.ts, 28, 3))
|
||||
>"a-b" : Symbol(C."a-b", Decl(newWithSpreadES6.ts, 14, 13))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
>i : Symbol(i, Decl(newWithSpreadES6.ts, 29, 3))
|
||||
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
>i : Symbol(i, Decl(newWithSpreadES6.ts, 29, 3))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
>i : Symbol(i, Decl(newWithSpreadES6.ts, 29, 3))
|
||||
>a : Symbol(a, Decl(newWithSpreadES6.ts, 22, 3))
|
||||
|
||||
471
tests/baselines/reference/newWithSpreadES6.types
Normal file
471
tests/baselines/reference/newWithSpreadES6.types
Normal file
@@ -0,0 +1,471 @@
|
||||
=== tests/cases/conformance/expressions/functionCalls/newWithSpreadES6.ts ===
|
||||
|
||||
function f(x: number, y: number, ...z: string[]) {
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
|
||||
interface A {
|
||||
>A : A
|
||||
|
||||
f: {
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
|
||||
new (x: number, y: number, ...z: string[]);
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
}
|
||||
|
||||
class B {
|
||||
>B : B
|
||||
|
||||
constructor(x: number, y: number, ...z: string[]) {}
|
||||
>x : number
|
||||
>y : number
|
||||
>z : string[]
|
||||
}
|
||||
|
||||
interface C {
|
||||
>C : C
|
||||
|
||||
"a-b": typeof B;
|
||||
>B : typeof B
|
||||
}
|
||||
|
||||
interface D {
|
||||
>D : D
|
||||
|
||||
1: typeof B;
|
||||
>B : typeof B
|
||||
}
|
||||
|
||||
var a: string[];
|
||||
>a : string[]
|
||||
|
||||
var b: A;
|
||||
>b : A
|
||||
>A : A
|
||||
|
||||
var c: C;
|
||||
>c : C
|
||||
>C : C
|
||||
|
||||
var d: A[];
|
||||
>d : A[]
|
||||
>A : A
|
||||
|
||||
var e: { [key: string]: A };
|
||||
>e : { [key: string]: A; }
|
||||
>key : string
|
||||
>A : A
|
||||
|
||||
var g: C[];
|
||||
>g : C[]
|
||||
>C : C
|
||||
|
||||
var h: { [key: string]: C };
|
||||
>h : { [key: string]: C; }
|
||||
>key : string
|
||||
>C : C
|
||||
|
||||
var i: C[][];
|
||||
>i : C[][]
|
||||
>C : C
|
||||
|
||||
// Basic expression
|
||||
new f(1, 2, "string");
|
||||
>new f(1, 2, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new f(1, 2, ...a);
|
||||
>new f(1, 2, ...a) : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new f(1, 2, ...a, "string");
|
||||
>new f(1, 2, ...a, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
>new f(1, 2, "string")() : any
|
||||
>new f(1, 2, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new f(1, 2, ...a)();
|
||||
>new f(1, 2, ...a)() : any
|
||||
>new f(1, 2, ...a) : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new f(1, 2, ...a, "string")();
|
||||
>new f(1, 2, ...a, "string")() : any
|
||||
>new f(1, 2, ...a, "string") : any
|
||||
>f : (x: number, y: number, ...z: string[]) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
>new b.f(1, 2, "string") : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new b.f(1, 2, ...a);
|
||||
>new b.f(1, 2, ...a) : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new b.f(1, 2, ...a, "string");
|
||||
>new b.f(1, 2, ...a, "string") : any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
>new (b.f)(1, 2, "string") : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new (b.f)(1, 2, ...a);
|
||||
>new (b.f)(1, 2, ...a) : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
>new (b.f)(1, 2, ...a, "string") : any
|
||||
>(b.f) : new (x: number, y: number, ...z: string[]) => any
|
||||
>b.f : new (x: number, y: number, ...z: string[]) => any
|
||||
>b : A
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
>new d[1].f(1, 2, "string") : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new d[1].f(1, 2, ...a);
|
||||
>new d[1].f(1, 2, ...a) : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
>new d[1].f(1, 2, ...a, "string") : any
|
||||
>d[1].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>d[1] : A
|
||||
>d : A[]
|
||||
>1 : number
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
>new e["a-b"].f(1, 2, "string") : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
>new e["a-b"].f(1, 2, ...a) : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
>new e["a-b"].f(1, 2, ...a, "string") : any
|
||||
>e["a-b"].f : new (x: number, y: number, ...z: string[]) => any
|
||||
>e["a-b"] : A
|
||||
>e : { [key: string]: A; }
|
||||
>"a-b" : string
|
||||
>f : new (x: number, y: number, ...z: string[]) => any
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
>new B(1, 2, "string") : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new B(1, 2, ...a);
|
||||
>new B(1, 2, ...a) : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new B(1, 2, ...a, "string");
|
||||
>new B(1, 2, ...a, "string") : B
|
||||
>B : typeof B
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
>new c["a-b"](1, 2, "string") : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new c["a-b"](1, 2, ...a);
|
||||
>new c["a-b"](1, 2, ...a) : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
>new c["a-b"](1, 2, ...a, "string") : B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
>new (c["a-b"])(1, 2, "string") : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
>new (c["a-b"])(1, 2, ...a) : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
>new (c["a-b"])(1, 2, ...a, "string") : B
|
||||
>(c["a-b"]) : typeof B
|
||||
>c["a-b"] : typeof B
|
||||
>c : C
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
>new g[1]["a-b"](1, 2, "string") : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
>new g[1]["a-b"](1, 2, ...a) : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
>new g[1]["a-b"](1, 2, ...a, "string") : B
|
||||
>g[1]["a-b"] : typeof B
|
||||
>g[1] : C
|
||||
>g : C[]
|
||||
>1 : number
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new h["a-b"]["a-b"](1, 2, "string");
|
||||
>new h["a-b"]["a-b"](1, 2, "string") : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a);
|
||||
>new h["a-b"]["a-b"](1, 2, ...a) : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
>new h["a-b"]["a-b"](1, 2, ...a, "string") : B
|
||||
>h["a-b"]["a-b"] : typeof B
|
||||
>h["a-b"] : C
|
||||
>h : { [key: string]: C; }
|
||||
>"a-b" : string
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
>new i["a-b"][1](1, 2, "string") : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>"string" : string
|
||||
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
>new i["a-b"][1](1, 2, ...a) : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
>new i["a-b"][1](1, 2, ...a, "string") : any
|
||||
>i["a-b"][1] : any
|
||||
>i["a-b"] : any
|
||||
>i : C[][]
|
||||
>"a-b" : string
|
||||
>1 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
>...a : string
|
||||
>a : string[]
|
||||
>"string" : string
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
@@ -0,0 +1,91 @@
|
||||
//@target: ES5
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
@@ -0,0 +1,91 @@
|
||||
//@target: ES6
|
||||
|
||||
function f(x: number, y: number, ...z: 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);
|
||||
new f(1, 2, ...a, "string");
|
||||
|
||||
// Call expression
|
||||
new f(1, 2, "string")();
|
||||
new f(1, 2, ...a)();
|
||||
new f(1, 2, ...a, "string")();
|
||||
|
||||
// Property access expression
|
||||
new b.f(1, 2, "string");
|
||||
new b.f(1, 2, ...a);
|
||||
new b.f(1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (b.f)(1, 2, "string");
|
||||
new (b.f)(1, 2, ...a);
|
||||
new (b.f)(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new d[1].f(1, 2, "string");
|
||||
new d[1].f(1, 2, ...a);
|
||||
new d[1].f(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a punctuated key
|
||||
new e["a-b"].f(1, 2, "string");
|
||||
new e["a-b"].f(1, 2, ...a);
|
||||
new e["a-b"].f(1, 2, ...a, "string");
|
||||
|
||||
// Basic expression
|
||||
new B(1, 2, "string");
|
||||
new B(1, 2, ...a);
|
||||
new B(1, 2, ...a, "string");
|
||||
|
||||
// Property access expression
|
||||
new c["a-b"](1, 2, "string");
|
||||
new c["a-b"](1, 2, ...a);
|
||||
new c["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Parenthesised expression
|
||||
new (c["a-b"])(1, 2, "string");
|
||||
new (c["a-b"])(1, 2, ...a);
|
||||
new (c["a-b"])(1, 2, ...a, "string");
|
||||
|
||||
// Element access expression
|
||||
new g[1]["a-b"](1, 2, "string");
|
||||
new g[1]["a-b"](1, 2, ...a);
|
||||
new g[1]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// 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);
|
||||
new h["a-b"]["a-b"](1, 2, ...a, "string");
|
||||
|
||||
// Element access expression with a number
|
||||
new i["a-b"][1](1, 2, "string");
|
||||
new i["a-b"][1](1, 2, ...a);
|
||||
new i["a-b"][1](1, 2, ...a, "string");
|
||||
Reference in New Issue
Block a user