mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 16:39:46 -05:00
merge tests
This commit is contained in:
@@ -1,10 +1,22 @@
|
||||
tests/cases/compiler/restParameterWithBindingPattern3.ts(1,16): error TS2322: Type '1' is not assignable to type 'string'.
|
||||
tests/cases/compiler/restParameterWithBindingPattern3.ts(1,23): error TS2322: Type 'true' is not assignable to type 'string'.
|
||||
tests/cases/compiler/restParameterWithBindingPattern3.ts(3,23): error TS1186: A rest element cannot have an initializer.
|
||||
tests/cases/compiler/restParameterWithBindingPattern3.ts(7,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/restParameterWithBindingPattern3.ts (2 errors) ====
|
||||
==== tests/cases/compiler/restParameterWithBindingPattern3.ts (4 errors) ====
|
||||
function a(...[a = 1, b = true]: string[]) { }
|
||||
~
|
||||
!!! error TS2322: Type '1' is not assignable to type 'string'.
|
||||
~
|
||||
!!! error TS2322: Type 'true' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type 'true' is not assignable to type 'string'.
|
||||
|
||||
function b(...[...foo = []]: string[]) { }
|
||||
~
|
||||
!!! error TS1186: A rest element cannot have an initializer.
|
||||
|
||||
function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
|
||||
function d(...[a, , , d]: [boolean, string, number]) { }
|
||||
~
|
||||
!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'.
|
||||
@@ -1,5 +1,11 @@
|
||||
//// [restParameterWithBindingPattern3.ts]
|
||||
function a(...[a = 1, b = true]: string[]) { }
|
||||
function a(...[a = 1, b = true]: string[]) { }
|
||||
|
||||
function b(...[...foo = []]: string[]) { }
|
||||
|
||||
function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
|
||||
function d(...[a, , , d]: [boolean, string, number]) { }
|
||||
|
||||
//// [restParameterWithBindingPattern3.js]
|
||||
function a() {
|
||||
@@ -9,3 +15,24 @@ function a() {
|
||||
}
|
||||
var _b = _a[0], a = _b === void 0 ? 1 : _b, _c = _a[1], b = _c === void 0 ? true : _c;
|
||||
}
|
||||
function b() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var _b = _a.slice(0), foo = _b === void 0 ? [] : _b;
|
||||
}
|
||||
function c() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var a = _a[0], length = _a.length, d = _a[3];
|
||||
}
|
||||
function d() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var a = _a[0], d = _a[3];
|
||||
}
|
||||
|
||||
@@ -4,3 +4,18 @@ function a(...[a = 1, b = true]: string[]) { }
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 0, 15))
|
||||
>b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 0, 21))
|
||||
|
||||
function b(...[...foo = []]: string[]) { }
|
||||
>b : Symbol(b, Decl(restParameterWithBindingPattern3.ts, 0, 46))
|
||||
>foo : Symbol(foo, Decl(restParameterWithBindingPattern3.ts, 2, 15))
|
||||
|
||||
function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
>c : Symbol(c, Decl(restParameterWithBindingPattern3.ts, 2, 42))
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 4, 15))
|
||||
>length : Symbol(length, Decl(restParameterWithBindingPattern3.ts, 4, 20))
|
||||
>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 4, 28))
|
||||
|
||||
function d(...[a, , , d]: [boolean, string, number]) { }
|
||||
>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 4, 66))
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern3.ts, 6, 15))
|
||||
>d : Symbol(d, Decl(restParameterWithBindingPattern3.ts, 6, 21))
|
||||
|
||||
|
||||
@@ -6,3 +6,21 @@ function a(...[a = 1, b = true]: string[]) { }
|
||||
>b : string
|
||||
>true : true
|
||||
|
||||
function b(...[...foo = []]: string[]) { }
|
||||
>b : (...[...foo]: string[]) => void
|
||||
>foo : string[]
|
||||
>[] : undefined[]
|
||||
|
||||
function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
>c : (__0_0: boolean, __0_1: string, __0_2: number) => void
|
||||
>a : boolean
|
||||
>length : 3
|
||||
>d : string | number | boolean
|
||||
|
||||
function d(...[a, , , d]: [boolean, string, number]) { }
|
||||
>d : (__0_0: boolean, __0_1: string, __0_2: number) => void
|
||||
>a : boolean
|
||||
> : undefined
|
||||
> : undefined
|
||||
>d : any
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
tests/cases/compiler/restParameterWithBindingPattern4.ts(1,23): error TS1186: A rest element cannot have an initializer.
|
||||
|
||||
|
||||
==== tests/cases/compiler/restParameterWithBindingPattern4.ts (1 errors) ====
|
||||
function a(...[...foo = []]: string[]) { }
|
||||
~
|
||||
!!! error TS1186: A rest element cannot have an initializer.
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [restParameterWithBindingPattern4.ts]
|
||||
function a(...[...foo = []]: string[]) { }
|
||||
|
||||
//// [restParameterWithBindingPattern4.js]
|
||||
function a() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var _b = _a.slice(0), foo = _b === void 0 ? [] : _b;
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern4.ts ===
|
||||
function a(...[...foo = []]: string[]) { }
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern4.ts, 0, 0))
|
||||
>foo : Symbol(foo, Decl(restParameterWithBindingPattern4.ts, 0, 15))
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern4.ts ===
|
||||
function a(...[...foo = []]: string[]) { }
|
||||
>a : (...[...foo]: string[]) => void
|
||||
>foo : string[]
|
||||
>[] : undefined[]
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [restParameterWithBindingPattern5.ts]
|
||||
function a(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
|
||||
//// [restParameterWithBindingPattern5.js]
|
||||
function a() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var a = _a[0], length = _a.length, d = _a[3];
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern5.ts ===
|
||||
function a(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern5.ts, 0, 15))
|
||||
>length : Symbol(length, Decl(restParameterWithBindingPattern5.ts, 0, 20))
|
||||
>d : Symbol(d, Decl(restParameterWithBindingPattern5.ts, 0, 28))
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern5.ts ===
|
||||
function a(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
>a : (__0_0: boolean, __0_1: string, __0_2: number) => void
|
||||
>a : boolean
|
||||
>length : 3
|
||||
>d : string | number | boolean
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
tests/cases/compiler/restParameterWithBindingPattern6.ts(1,23): error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/restParameterWithBindingPattern6.ts (1 errors) ====
|
||||
function a(...[a, , , d]: [boolean, string, number]) { }
|
||||
~
|
||||
!!! error TS2493: Tuple type '[boolean, string, number]' with length '3' cannot be assigned to tuple with length '4'.
|
||||
@@ -1,11 +0,0 @@
|
||||
//// [restParameterWithBindingPattern6.ts]
|
||||
function a(...[a, , , d]: [boolean, string, number]) { }
|
||||
|
||||
//// [restParameterWithBindingPattern6.js]
|
||||
function a() {
|
||||
var _a = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
_a[_i] = arguments[_i];
|
||||
}
|
||||
var a = _a[0], d = _a[3];
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern6.ts ===
|
||||
function a(...[a, , , d]: [boolean, string, number]) { }
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(restParameterWithBindingPattern6.ts, 0, 15))
|
||||
>d : Symbol(d, Decl(restParameterWithBindingPattern6.ts, 0, 21))
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
=== tests/cases/compiler/restParameterWithBindingPattern6.ts ===
|
||||
function a(...[a, , , d]: [boolean, string, number]) { }
|
||||
>a : (__0_0: boolean, __0_1: string, __0_2: number) => void
|
||||
>a : boolean
|
||||
> : undefined
|
||||
> : undefined
|
||||
>d : any
|
||||
|
||||
@@ -1 +1,7 @@
|
||||
function a(...[a = 1, b = true]: string[]) { }
|
||||
function a(...[a = 1, b = true]: string[]) { }
|
||||
|
||||
function b(...[...foo = []]: string[]) { }
|
||||
|
||||
function c(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
|
||||
function d(...[a, , , d]: [boolean, string, number]) { }
|
||||
@@ -1 +0,0 @@
|
||||
function a(...[...foo = []]: string[]) { }
|
||||
@@ -1 +0,0 @@
|
||||
function a(...{0: a, length, 3: d}: [boolean, string, number]) { }
|
||||
@@ -1 +0,0 @@
|
||||
function a(...[a, , , d]: [boolean, string, number]) { }
|
||||
Reference in New Issue
Block a user