Skip to content

Commit cc7a24c

Browse files
committed
Accept new baselines
1 parent 5ad3d1b commit cc7a24c

4 files changed

+425
-0
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(1,15): error TS7031: Binding element 'x' implicitly has an 'any' type.
2+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(1,18): error TS7031: Binding element 'y' implicitly has an 'any' type.
3+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(2,15): error TS7031: Binding element 'x' implicitly has an 'any' type.
4+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(2,18): error TS7031: Binding element 'y' implicitly has an 'any' type.
5+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(3,18): error TS7031: Binding element 'y' implicitly has an 'any' type.
6+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(6,22): error TS7031: Binding element 'y' implicitly has an 'any' type.
7+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(7,22): error TS7031: Binding element 'y' implicitly has an 'any' type.
8+
tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts(8,22): error TS7031: Binding element 'y' implicitly has an 'any' type.
9+
10+
11+
==== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts (8 errors) ====
12+
function f00([x, y]) {}
13+
~
14+
!!! error TS7031: Binding element 'x' implicitly has an 'any' type.
15+
~
16+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
17+
function f01([x, y] = []) {}
18+
~
19+
!!! error TS7031: Binding element 'x' implicitly has an 'any' type.
20+
~
21+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
22+
function f02([x, y] = [1]) {}
23+
~
24+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
25+
function f03([x, y] = [1, 'foo']) {}
26+
27+
function f10([x = 0, y]) {}
28+
~
29+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
30+
function f11([x = 0, y] = []) {}
31+
~
32+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
33+
function f12([x = 0, y] = [1]) {}
34+
~
35+
!!! error TS7031: Binding element 'y' implicitly has an 'any' type.
36+
function f13([x = 0, y] = [1, 'foo']) {}
37+
38+
function f20([x = 0, y = 'bar']) {}
39+
function f21([x = 0, y = 'bar'] = []) {}
40+
function f22([x = 0, y = 'bar'] = [1]) {}
41+
function f23([x = 0, y = 'bar'] = [1, 'foo']) {}
42+
43+
declare const nx: number | undefined;
44+
declare const sx: string | undefined;
45+
46+
function f30([x = 0, y = 'bar']) {}
47+
function f31([x = 0, y = 'bar'] = []) {}
48+
function f32([x = 0, y = 'bar'] = [nx]) {}
49+
function f33([x = 0, y = 'bar'] = [nx, sx]) {}
50+
51+
function f40([x = 0, y = 'bar']) {}
52+
function f41([x = 0, y = 'bar'] = []) {}
53+
function f42([x = 0, y = 'bar'] = [sx]) {}
54+
function f43([x = 0, y = 'bar'] = [sx, nx]) {}
55+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
//// [destructuringWithLiteralInitializers2.ts]
2+
function f00([x, y]) {}
3+
function f01([x, y] = []) {}
4+
function f02([x, y] = [1]) {}
5+
function f03([x, y] = [1, 'foo']) {}
6+
7+
function f10([x = 0, y]) {}
8+
function f11([x = 0, y] = []) {}
9+
function f12([x = 0, y] = [1]) {}
10+
function f13([x = 0, y] = [1, 'foo']) {}
11+
12+
function f20([x = 0, y = 'bar']) {}
13+
function f21([x = 0, y = 'bar'] = []) {}
14+
function f22([x = 0, y = 'bar'] = [1]) {}
15+
function f23([x = 0, y = 'bar'] = [1, 'foo']) {}
16+
17+
declare const nx: number | undefined;
18+
declare const sx: string | undefined;
19+
20+
function f30([x = 0, y = 'bar']) {}
21+
function f31([x = 0, y = 'bar'] = []) {}
22+
function f32([x = 0, y = 'bar'] = [nx]) {}
23+
function f33([x = 0, y = 'bar'] = [nx, sx]) {}
24+
25+
function f40([x = 0, y = 'bar']) {}
26+
function f41([x = 0, y = 'bar'] = []) {}
27+
function f42([x = 0, y = 'bar'] = [sx]) {}
28+
function f43([x = 0, y = 'bar'] = [sx, nx]) {}
29+
30+
31+
//// [destructuringWithLiteralInitializers2.js]
32+
"use strict";
33+
function f00(_a) {
34+
var x = _a[0], y = _a[1];
35+
}
36+
function f01(_a) {
37+
var _b = _a === void 0 ? [] : _a, x = _b[0], y = _b[1];
38+
}
39+
function f02(_a) {
40+
var _b = _a === void 0 ? [1] : _a, x = _b[0], y = _b[1];
41+
}
42+
function f03(_a) {
43+
var _b = _a === void 0 ? [1, 'foo'] : _a, x = _b[0], y = _b[1];
44+
}
45+
function f10(_a) {
46+
var _b = _a[0], x = _b === void 0 ? 0 : _b, y = _a[1];
47+
}
48+
function f11(_a) {
49+
var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1];
50+
}
51+
function f12(_a) {
52+
var _b = _a === void 0 ? [1] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1];
53+
}
54+
function f13(_a) {
55+
var _b = _a === void 0 ? [1, 'foo'] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, y = _b[1];
56+
}
57+
function f20(_a) {
58+
var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c;
59+
}
60+
function f21(_a) {
61+
var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
62+
}
63+
function f22(_a) {
64+
var _b = _a === void 0 ? [1] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
65+
}
66+
function f23(_a) {
67+
var _b = _a === void 0 ? [1, 'foo'] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
68+
}
69+
function f30(_a) {
70+
var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c;
71+
}
72+
function f31(_a) {
73+
var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
74+
}
75+
function f32(_a) {
76+
var _b = _a === void 0 ? [nx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
77+
}
78+
function f33(_a) {
79+
var _b = _a === void 0 ? [nx, sx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
80+
}
81+
function f40(_a) {
82+
var _b = _a[0], x = _b === void 0 ? 0 : _b, _c = _a[1], y = _c === void 0 ? 'bar' : _c;
83+
}
84+
function f41(_a) {
85+
var _b = _a === void 0 ? [] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
86+
}
87+
function f42(_a) {
88+
var _b = _a === void 0 ? [sx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
89+
}
90+
function f43(_a) {
91+
var _b = _a === void 0 ? [sx, nx] : _a, _c = _b[0], x = _c === void 0 ? 0 : _c, _d = _b[1], y = _d === void 0 ? 'bar' : _d;
92+
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
=== tests/cases/conformance/es6/destructuring/destructuringWithLiteralInitializers2.ts ===
2+
function f00([x, y]) {}
3+
>f00 : Symbol(f00, Decl(destructuringWithLiteralInitializers2.ts, 0, 0))
4+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 0, 14))
5+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 0, 16))
6+
7+
function f01([x, y] = []) {}
8+
>f01 : Symbol(f01, Decl(destructuringWithLiteralInitializers2.ts, 0, 23))
9+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 1, 14))
10+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 1, 16))
11+
12+
function f02([x, y] = [1]) {}
13+
>f02 : Symbol(f02, Decl(destructuringWithLiteralInitializers2.ts, 1, 28))
14+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 2, 14))
15+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 2, 16))
16+
17+
function f03([x, y] = [1, 'foo']) {}
18+
>f03 : Symbol(f03, Decl(destructuringWithLiteralInitializers2.ts, 2, 29))
19+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 3, 14))
20+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 3, 16))
21+
22+
function f10([x = 0, y]) {}
23+
>f10 : Symbol(f10, Decl(destructuringWithLiteralInitializers2.ts, 3, 36))
24+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 5, 14))
25+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 5, 20))
26+
27+
function f11([x = 0, y] = []) {}
28+
>f11 : Symbol(f11, Decl(destructuringWithLiteralInitializers2.ts, 5, 27))
29+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 6, 14))
30+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 6, 20))
31+
32+
function f12([x = 0, y] = [1]) {}
33+
>f12 : Symbol(f12, Decl(destructuringWithLiteralInitializers2.ts, 6, 32))
34+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 7, 14))
35+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 7, 20))
36+
37+
function f13([x = 0, y] = [1, 'foo']) {}
38+
>f13 : Symbol(f13, Decl(destructuringWithLiteralInitializers2.ts, 7, 33))
39+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 8, 14))
40+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 8, 20))
41+
42+
function f20([x = 0, y = 'bar']) {}
43+
>f20 : Symbol(f20, Decl(destructuringWithLiteralInitializers2.ts, 8, 40))
44+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 10, 14))
45+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 10, 20))
46+
47+
function f21([x = 0, y = 'bar'] = []) {}
48+
>f21 : Symbol(f21, Decl(destructuringWithLiteralInitializers2.ts, 10, 35))
49+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 11, 14))
50+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 11, 20))
51+
52+
function f22([x = 0, y = 'bar'] = [1]) {}
53+
>f22 : Symbol(f22, Decl(destructuringWithLiteralInitializers2.ts, 11, 40))
54+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 12, 14))
55+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 12, 20))
56+
57+
function f23([x = 0, y = 'bar'] = [1, 'foo']) {}
58+
>f23 : Symbol(f23, Decl(destructuringWithLiteralInitializers2.ts, 12, 41))
59+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 13, 14))
60+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 13, 20))
61+
62+
declare const nx: number | undefined;
63+
>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13))
64+
65+
declare const sx: string | undefined;
66+
>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13))
67+
68+
function f30([x = 0, y = 'bar']) {}
69+
>f30 : Symbol(f30, Decl(destructuringWithLiteralInitializers2.ts, 16, 37))
70+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 18, 14))
71+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 18, 20))
72+
73+
function f31([x = 0, y = 'bar'] = []) {}
74+
>f31 : Symbol(f31, Decl(destructuringWithLiteralInitializers2.ts, 18, 35))
75+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 19, 14))
76+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 19, 20))
77+
78+
function f32([x = 0, y = 'bar'] = [nx]) {}
79+
>f32 : Symbol(f32, Decl(destructuringWithLiteralInitializers2.ts, 19, 40))
80+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 20, 14))
81+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 20, 20))
82+
>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13))
83+
84+
function f33([x = 0, y = 'bar'] = [nx, sx]) {}
85+
>f33 : Symbol(f33, Decl(destructuringWithLiteralInitializers2.ts, 20, 42))
86+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 21, 14))
87+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 21, 20))
88+
>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13))
89+
>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13))
90+
91+
function f40([x = 0, y = 'bar']) {}
92+
>f40 : Symbol(f40, Decl(destructuringWithLiteralInitializers2.ts, 21, 46))
93+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 23, 14))
94+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 23, 20))
95+
96+
function f41([x = 0, y = 'bar'] = []) {}
97+
>f41 : Symbol(f41, Decl(destructuringWithLiteralInitializers2.ts, 23, 35))
98+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 24, 14))
99+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 24, 20))
100+
101+
function f42([x = 0, y = 'bar'] = [sx]) {}
102+
>f42 : Symbol(f42, Decl(destructuringWithLiteralInitializers2.ts, 24, 40))
103+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 25, 14))
104+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 25, 20))
105+
>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13))
106+
107+
function f43([x = 0, y = 'bar'] = [sx, nx]) {}
108+
>f43 : Symbol(f43, Decl(destructuringWithLiteralInitializers2.ts, 25, 42))
109+
>x : Symbol(x, Decl(destructuringWithLiteralInitializers2.ts, 26, 14))
110+
>y : Symbol(y, Decl(destructuringWithLiteralInitializers2.ts, 26, 20))
111+
>sx : Symbol(sx, Decl(destructuringWithLiteralInitializers2.ts, 16, 13))
112+
>nx : Symbol(nx, Decl(destructuringWithLiteralInitializers2.ts, 15, 13))
113+

0 commit comments

Comments
 (0)