Skip to content

Commit 273b9ff

Browse files
committed
Accepting new baselines
1 parent a95c423 commit 273b9ff

19 files changed

+242
-770
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
2+
tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
3+
tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
4+
5+
6+
==== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts (3 errors) ====
7+
var [x10, [y10, [z10]]] = [1, ["hello", [true]]];
8+
9+
var [x11 = 0, y11 = ""] = [1, "hello"];
10+
var [a11, b11, c11] = [];
11+
~~~
12+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
13+
~~~
14+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
15+
~~~
16+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
17+
18+
var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]];
19+
20+
var [x13, y13] = [1, "hello"];
21+
var [a3, b3] = [[x13, y13], { x: x13, y: y13 }];
22+

tests/baselines/reference/declarationEmitDestructuringArrayPattern2.symbols

Lines changed: 0 additions & 40 deletions
This file was deleted.

tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types

Lines changed: 0 additions & 70 deletions
This file was deleted.

tests/baselines/reference/declarationsAndAssignments.errors.txt

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(5,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
12
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(22,17): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{}'.
23
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(22,23): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{}'.
34
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'.
45
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
56
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'.
67
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
78
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(56,17): error TS2322: Type 'number' is not assignable to type 'string'.
9+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
10+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
11+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
12+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
13+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
814
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(67,9): error TS2461: Type '{ [x: number]: undefined; }' is not an array type.
915
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(68,9): error TS2461: Type '{ [x: number]: number; 0: number; 1: number; }' is not an array type.
10-
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): error TS2459: Type '{}' has no property 'a' and no string index signature.
11-
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,14): error TS2459: Type '{}' has no property 'b' and no string index signature.
16+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
17+
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(73,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
1218
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,11): error TS2459: Type 'undefined[]' has no property 'a' and no string index signature.
1319
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(74,14): error TS2459: Type 'undefined[]' has no property 'b' and no string index signature.
1420
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(106,5): error TS2345: Argument of type '[number, [string, { y: boolean; }]]' is not assignable to parameter of type '[number, [string, { x: any; y?: boolean; }]]'.
@@ -21,12 +27,14 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,6):
2127
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): error TS2322: Type 'number' is not assignable to type 'string'.
2228

2329

24-
==== tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts (16 errors) ====
30+
==== tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts (22 errors) ====
2531
function f0() {
2632
var [] = [1, "hello"];
2733
var [x] = [1, "hello"];
2834
var [x, y] = [1, "hello"];
2935
var [x, y, z] = [1, "hello"];
36+
~
37+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
3038
var [,, x] = [0, 1, 2];
3139
var x: number;
3240
var y: string;
@@ -98,7 +106,17 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9):
98106

99107
function f8() {
100108
var [a, b, c] = []; // Ok, [] is an array
109+
~
110+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
111+
~
112+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
113+
~
114+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
101115
var [d, e, f] = [1]; // Error, [1] is a tuple
116+
~
117+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
118+
~
119+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
102120
}
103121

104122
function f9() {
@@ -114,9 +132,9 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9):
114132
function f10() {
115133
var { a, b } = {}; // Error
116134
~
117-
!!! error TS2459: Type '{}' has no property 'a' and no string index signature.
135+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
118136
~
119-
!!! error TS2459: Type '{}' has no property 'b' and no string index signature.
137+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
120138
var { a, b } = []; // Error
121139
~
122140
!!! error TS2459: Type 'undefined[]' has no property 'a' and no string index signature.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
2+
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
3+
tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value
4+
5+
6+
==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts (3 errors) ====
7+
/* AssignmentPattern:
8+
* ObjectAssignmentPattern
9+
* ArrayAssignmentPattern
10+
* ArrayAssignmentPattern:
11+
* [Elision<opt> AssignmentRestElementopt ]
12+
* [AssignmentElementList]
13+
* [AssignmentElementList, Elision<opt> AssignmentRestElementopt ]
14+
* AssignmentElementList:
15+
* Elision<opt> AssignmentElement
16+
* AssignmentElementList, Elisionopt AssignmentElement
17+
* AssignmentElement:
18+
* LeftHandSideExpression Initialiseropt
19+
* AssignmentPattern Initialiseropt
20+
* AssignmentRestElement:
21+
* ... LeftHandSideExpression
22+
*/
23+
24+
// In a destructuring assignment expression, the type of the expression on the right must be assignable to the assignment target on the left.
25+
// An expression of type S is considered assignable to an assignment target V if one of the following is true
26+
27+
// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
28+
// S is the type Any, or
29+
30+
var [a0, a1]: any = undefined;
31+
var [a2 = false, a3 = 1]: any = undefined;
32+
33+
// V is an array assignment pattern, S is the type Any or an array-like type (section 3.3.2), and, for each assignment element E in V,
34+
// S is a tuple- like type (section 3.3.3) with a property named N of a type that is assignable to the target given in E,
35+
// where N is the numeric index of E in the array assignment pattern, or
36+
var [b0, b1, b2] = [2, 3, 4];
37+
var [b3, b4, b5]: [number, number, string] = [1, 2, "string"];
38+
39+
function foo() {
40+
return [1, 2, 3];
41+
}
42+
43+
var [b6, b7] = foo();
44+
var [...b8] = foo();
45+
46+
// S is not a tuple- like type and the numeric index signature type of S is assignable to the target given in E.
47+
var temp = [1,2,3]
48+
var [c0, c1] = [...temp];
49+
var [c2] = [];
50+
~~
51+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
52+
var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]]
53+
~~
54+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
55+
~~
56+
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value
57+
var [[c5], c6]: [[string|number], boolean] = [[1], true];
58+
var [, c7] = [1, 2, 3];
59+
var [,,, c8] = [1, 2, 3, 4];
60+
var [,,, c9] = [1, 2, 3, 4];
61+
var [,,,...c10] = [1, 2, 3, 4, "hello"];
62+
var [c11, c12, ...c13] = [1, 2, "string"];
63+
var [c14, c15, c16] = [1, 2, "string"];
64+
65+

0 commit comments

Comments
 (0)