diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt index 26998fd83ae..e782352073a 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.errors.txt @@ -1,6 +1,6 @@ -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. -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. -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. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,11): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. +tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error TS2493: Tuple type '[]' of length '0' has no element at index '2'. ==== tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts (3 errors) ==== @@ -9,11 +9,11 @@ tests/cases/compiler/declarationEmitDestructuringArrayPattern2.ts(4,16): error T var [x11 = 0, y11 = ""] = [1, "hello"]; var [a11, b11, c11] = []; ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '2'. var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js index 818b3a6f7a9..663b2d3567b 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.js @@ -22,7 +22,7 @@ var _m = [[x13, y13], { x: x13, y: y13 }], a3 = _m[0], b3 = _m[1]; //// [declarationEmitDestructuringArrayPattern2.d.ts] declare var x10: number, y10: string, z10: boolean; declare var x11: number, y11: string; -declare var a11: any, b11: any, c11: any; +declare var a11: undefined, b11: undefined, c11: undefined; declare var a2: number, b2: string, x12: number, c2: boolean; declare var x13: number, y13: string; declare var a3: (string | number)[], b3: { diff --git a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types index 37781e0a1ae..b473e544ae1 100644 --- a/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types +++ b/tests/baselines/reference/declarationEmitDestructuringArrayPattern2.types @@ -20,10 +20,10 @@ var [x11 = 0, y11 = ""] = [1, "hello"]; >"hello" : "hello" var [a11, b11, c11] = []; ->a11 : any ->b11 : any ->c11 : any ->[] : [undefined?, undefined?, undefined?] +>a11 : undefined +>b11 : undefined +>c11 : undefined +>[] : [] var [a2, [b2, { x12, y12: c2 }]=["abc", { x12: 10, y12: false }]] = [1, ["hello", { x12: 5, y12: true }]]; >a2 : number diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index b13aacbfbc3..d6f0ab3873a 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -1,4 +1,4 @@ -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. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(5,16): error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. 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 '{}'. 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 '{}'. 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; }'. @@ -6,11 +6,11 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): 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; }'. 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; }'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. -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. -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. -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. -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. -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. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2493: Tuple type '[]' of length '0' has no element at index '2'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,13): error TS2493: Tuple type '[number]' of length '1' has no element at index '1'. +tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(63,16): error TS2493: Tuple type '[number]' of length '1' has no element at index '2'. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(67,9): error TS2461: Type '{}' is not an array type. tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(68,9): error TS2461: Type '{ 0: number; 1: number; }' is not an array type. 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. @@ -29,7 +29,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): var [x, y] = [1, "hello"]; var [x, y, z] = [1, "hello"]; ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number, string]' of length '2' has no element at index '2'. var [,, x] = [0, 1, 2]; var x: number; var y: string; @@ -103,16 +103,16 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): function f8() { var [a, b, c] = []; // Error, [] is an empty tuple ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '2'. var [d, e, f] = [1]; // Error, [1] is a tuple ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number]' of length '1' has no element at index '1'. ~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[number]' of length '1' has no element at index '2'. } function f9() { diff --git a/tests/baselines/reference/declarationsAndAssignments.types b/tests/baselines/reference/declarationsAndAssignments.types index 89ddd0eb5e5..ed157a7e69c 100644 --- a/tests/baselines/reference/declarationsAndAssignments.types +++ b/tests/baselines/reference/declarationsAndAssignments.types @@ -23,8 +23,8 @@ function f0() { var [x, y, z] = [1, "hello"]; >x : number >y : string ->z : any ->[1, "hello"] : [number, string, undefined?] +>z : undefined +>[1, "hello"] : [number, string] >1 : 1 >"hello" : "hello" @@ -255,16 +255,16 @@ function f8() { >f8 : () => void var [a, b, c] = []; // Error, [] is an empty tuple ->a : any ->b : any ->c : any ->[] : [undefined?, undefined?, undefined?] +>a : undefined +>b : undefined +>c : undefined +>[] : [] var [d, e, f] = [1]; // Error, [1] is a tuple >d : number ->e : any ->f : any ->[1] : [number, undefined?, undefined?] +>e : undefined +>f : undefined +>[1] : [number] >1 : 1 } diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt index 1f1bc85757b..17a9dc13f9a 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.errors.txt @@ -1,6 +1,6 @@ -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. -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. -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. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types index 03990bc0846..d9e9cb494d2 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt index 6a2647013fb..21e239114cb 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES5iterable.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types index cb2e8018232..6d232030fae 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES5iterable.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt index 4dc6085e662..3dc897456aa 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(43,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(43,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts(44,18): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment1ES6.ts (3 errors) ==== @@ -48,12 +48,12 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss var [c0, c1] = [...temp]; var [c2] = []; ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. var [[c5], c6]: [[string|number], boolean] = [[1], true]; var [, c7] = [1, 2, 3]; var [,,, c8] = [1, 2, 3, 4]; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types index 9a00291f79c..feb0116ea04 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment1ES6.types @@ -92,19 +92,19 @@ var [c0, c1] = [...temp]; >temp : number[] var [c2] = []; ->c2 : any ->[] : [undefined?] +>c2 : undefined +>[] : [] var [[[c3]], [[[[c4]]]]] = [[[]], [[[[]]]]] ->c3 : any ->c4 : any ->[[[]], [[[[]]]]] : [[[undefined?]], [[[[undefined?]]]]] ->[[]] : [[undefined?]] ->[] : [undefined?] ->[[[[]]]] : [[[[undefined?]]]] ->[[[]]] : [[[undefined?]]] ->[[]] : [[undefined?]] ->[] : [undefined?] +>c3 : undefined +>c4 : undefined +>[[[]], [[[[]]]]] : [[[]], [[[[]]]]] +>[[]] : [[]] +>[] : [] +>[[[[]]]] : [[[[]]]] +>[[[]]] : [[[]]] +>[[]] : [[]] +>[] : [] var [[c5], c6]: [[string|number], boolean] = [[1], true]; >c5 : string | number diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt index 6d16229f333..dd01ac96519 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2461: Type 'undefined' is not an array type. -tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(3,12): error TS2493: Tuple type '[]' of length '0' has no element at index '1'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(4,5): error TS2461: Type 'undefined' is not an array type. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(9,51): error TS2322: Type 'number' is not assignable to type 'boolean'. tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment2.ts(22,5): error TS2739: Type 'number[]' is missing the following properties from type '[number, number]': 0, 1 @@ -16,11 +16,11 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss ~~~~ !!! error TS2461: Type 'undefined' is not an array type. ~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ~~~~~~ !!! error TS2461: Type 'undefined' is not an array type. ~~~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '1'. var [[a2], [[a3]]] = undefined // Error ~~~~~~~~~~~~~~ !!! error TS2461: Type 'undefined' is not an array type. diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types index 77681f8d8c8..86723735bb5 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment2.types @@ -4,7 +4,7 @@ var [[a0], [[a1]]] = [] // Error >a0 : any >a1 : any ->[] : [undefined?, undefined?] +>[] : [] var [[a2], [[a3]]] = undefined // Error >a2 : any diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types index 0fb81ba6aa3..5a0e03dda6e 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.types @@ -3,7 +3,7 @@ const [a, b = a] = [1]; // ok >a : any >b : any >a : any ->[1] : [number, any?] +>[1] : [number] >1 : 1 const [c, d = c, e = e] = [1]; // error for e = e @@ -12,7 +12,7 @@ const [c, d = c, e = e] = [1]; // error for e = e >c : any >e : any >e : any ->[1] : [number, any?, any?] +>[1] : [number] >1 : 1 const [f, g = f, h = i, i = f] = [1]; // error for h = i @@ -23,7 +23,7 @@ const [f, g = f, h = i, i = f] = [1]; // error for h = i >i : any >i : any >f : any ->[1] : [number, any?, any?, any?] +>[1] : [number] >1 : 1 (function ([a, b = a]) { // ok diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types index fc153be7c60..0e1a89eff93 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES5.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES5.types @@ -151,9 +151,9 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f4 : number >f5 : number > : undefined ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, undefined?]; } ->f : [number, number, { f3: number; f5: number; }, undefined?] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, undefined?] +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] >1 : 1 >2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types index bf00e1955ca..d47ec0e0d74 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration1ES6.types +++ b/tests/baselines/reference/destructuringVariableDeclaration1ES6.types @@ -151,9 +151,9 @@ var {f: [f1, f2, { f3: f4, f5 }, , ]} = { f: [1, 2, { f3: 4, f5: 0 }] }; >f4 : number >f5 : number > : undefined ->{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }, undefined?]; } ->f : [number, number, { f3: number; f5: number; }, undefined?] ->[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }, undefined?] +>{ f: [1, 2, { f3: 4, f5: 0 }] } : { f: [number, number, { f3: number; f5: number; }]; } +>f : [number, number, { f3: number; f5: number; }] +>[1, 2, { f3: 4, f5: 0 }] : [number, number, { f3: number; f5: number; }] >1 : 1 >2 : 2 >{ f3: 4, f5: 0 } : { f3: number; f5: number; } diff --git a/tests/baselines/reference/destructuringVariableDeclaration2.types b/tests/baselines/reference/destructuringVariableDeclaration2.types index ddb560f4e24..3b4fe8af85f 100644 --- a/tests/baselines/reference/destructuringVariableDeclaration2.types +++ b/tests/baselines/reference/destructuringVariableDeclaration2.types @@ -60,7 +60,7 @@ var [c1, c2, { c3: c4, c5 }, , ...c6] = [1, 2, { c3: 4, c5: 0 }]; // Error >c5 : number > : undefined >c6 : [] ->[1, 2, { c3: 4, c5: 0 }] : [number, number, { c3: number; c5: number; }, undefined?] +>[1, 2, { c3: 4, c5: 0 }] : [number, number, { c3: number; c5: number; }] >1 : 1 >2 : 2 >{ c3: 4, c5: 0 } : { c3: number; c5: number; } diff --git a/tests/baselines/reference/downlevelLetConst12.errors.txt b/tests/baselines/reference/downlevelLetConst12.errors.txt index 7d5c6828207..8c4bcb9d4f7 100644 --- a/tests/baselines/reference/downlevelLetConst12.errors.txt +++ b/tests/baselines/reference/downlevelLetConst12.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/downlevelLetConst12.ts(6,6): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. -tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +tests/cases/compiler/downlevelLetConst12.ts(6,6): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. +tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2493: Tuple type '[]' of length '0' has no element at index '0'. ==== tests/cases/compiler/downlevelLetConst12.ts (2 errors) ==== @@ -10,10 +10,10 @@ tests/cases/compiler/downlevelLetConst12.ts(9,8): error TS2525: Initializer prov let [baz] = []; ~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. let {a: baz2} = { a: 1 }; const [baz3] = [] ~~~~ -!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. +!!! error TS2493: Tuple type '[]' of length '0' has no element at index '0'. const {a: baz4} = { a: 1 }; \ No newline at end of file diff --git a/tests/baselines/reference/downlevelLetConst12.types b/tests/baselines/reference/downlevelLetConst12.types index 25316e67eb4..3f64d06788c 100644 --- a/tests/baselines/reference/downlevelLetConst12.types +++ b/tests/baselines/reference/downlevelLetConst12.types @@ -11,8 +11,8 @@ const bar = 1; >1 : 1 let [baz] = []; ->baz : any ->[] : [undefined?] +>baz : undefined +>[] : [] let {a: baz2} = { a: 1 }; >a : any @@ -22,8 +22,8 @@ let {a: baz2} = { a: 1 }; >1 : 1 const [baz3] = [] ->baz3 : any ->[] : [undefined?] +>baz3 : undefined +>[] : [] const {a: baz4} = { a: 1 }; >a : any diff --git a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types index 823af520806..8a60da05e6d 100644 --- a/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types +++ b/tests/baselines/reference/noImplicitAnyDestructuringVarDeclaration.types @@ -44,5 +44,5 @@ var [a4] = [undefined], {b4} = { b4: null }, c4 = undefined, d4 = null; // error var [a5 = undefined] = []; // error >a5 : any >undefined : undefined ->[] : [undefined?] +>[] : [] diff --git a/tests/baselines/reference/recursiveLetConst.types b/tests/baselines/reference/recursiveLetConst.types index 90b0d7baab1..7525d6242b6 100644 --- a/tests/baselines/reference/recursiveLetConst.types +++ b/tests/baselines/reference/recursiveLetConst.types @@ -49,7 +49,7 @@ for (let [v] of v) { } let [x2 = x2] = [] >x2 : any >x2 : any ->[] : [any?] +>[] : [] let z0 = () => z0; >z0 : () => any diff --git a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types index fb9e4aca6b5..2f9d1dac6e3 100644 --- a/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types +++ b/tests/baselines/reference/sourceMapValidationDestructuringVariableStatementArrayBindingPatternDefaultValues3.types @@ -234,11 +234,11 @@ let multiRobotAInfo: (string | string[])[]; [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB; >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = multiRobotB : [string, string[]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -246,16 +246,16 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] >multiRobotB : [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB(); >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = getMultiRobotB() : [string, string[]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -263,17 +263,17 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] >getMultiRobotB() : [string, string[]] >getMultiRobotB : () => [string, string[]] [nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = >[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] = ["trimmer", ["trimming", "edging"]] : [string, [string, string]] ->[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, [string?, string?]] +>[nameMB = "helloNoName", [primarySkillB = "noSkill", secondarySkillB = "noSkill"] = []] : [string, []] >nameMB = "helloNoName" : "helloNoName" >nameMB : string >"helloNoName" : "helloNoName" ->[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [string?, string?] +>[primarySkillB = "noSkill", secondarySkillB = "noSkill"] = [] : [] >[primarySkillB = "noSkill", secondarySkillB = "noSkill"] : [string, string] >primarySkillB = "noSkill" : "noSkill" >primarySkillB : string @@ -281,7 +281,7 @@ let multiRobotAInfo: (string | string[])[]; >secondarySkillB = "noSkill" : "noSkill" >secondarySkillB : string >"noSkill" : "noSkill" ->[] : [string?, string?] +>[] : [] ["trimmer", ["trimming", "edging"]]; >["trimmer", ["trimming", "edging"]] : [string, [string, string]]