|
| 1 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(1,6): error TS7031: Binding element 'a' implicitly has an 'any' type. |
| 2 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(1,9): error TS7031: Binding element 'b' implicitly has an 'any' type. |
| 3 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(1,12): error TS7031: Binding element 'c' implicitly has an 'any' type. |
| 4 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(3,6): error TS7031: Binding element 'a2' implicitly has an 'any' type. |
| 5 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(3,22): error TS7031: Binding element 'b2' implicitly has an 'any' type. |
| 6 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(3,38): error TS7031: Binding element 'c2' implicitly has an 'any' type. |
| 7 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(5,6): error TS7031: Binding element 'a4' implicitly has an 'any' type. |
| 8 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(5,31): error TS7031: Binding element 'b4' implicitly has an 'any' type. |
| 9 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(7,6): error TS7031: Binding element 'x' implicitly has an 'any' type. |
| 10 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(7,9): error TS7031: Binding element 'y' implicitly has an 'any' type. |
| 11 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(7,12): error TS7031: Binding element 'z' implicitly has an 'any' type. |
| 12 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(9,6): error TS7031: Binding element 'x2' implicitly has an 'any' type. |
| 13 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(9,22): error TS7031: Binding element 'y2' implicitly has an 'any' type. |
| 14 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(9,38): error TS7031: Binding element 'z2' implicitly has an 'any' type. |
| 15 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(11,6): error TS7031: Binding element 'x4' implicitly has an 'any' type. |
| 16 | +tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts(11,37): error TS7031: Binding element 'y4' implicitly has an 'any' type. |
| 17 | + |
| 18 | + |
| 19 | +==== tests/cases/compiler/noImplicitAnyDestructuringVarDeclaration2.ts (16 errors) ==== |
| 20 | + let [a, b, c] = [1, 2, 3]; // no error |
| 21 | + ~ |
| 22 | +!!! error TS7031: Binding element 'a' implicitly has an 'any' type. |
| 23 | + ~ |
| 24 | +!!! error TS7031: Binding element 'b' implicitly has an 'any' type. |
| 25 | + ~ |
| 26 | +!!! error TS7031: Binding element 'c' implicitly has an 'any' type. |
| 27 | + let [a1 = 10, b1 = 10, c1 = 10] = [1, 2, 3]; // no error |
| 28 | + let [a2 = undefined, b2 = undefined, c2 = undefined] = [1, 2, 3]; // no error |
| 29 | + ~~ |
| 30 | +!!! error TS7031: Binding element 'a2' implicitly has an 'any' type. |
| 31 | + ~~ |
| 32 | +!!! error TS7031: Binding element 'b2' implicitly has an 'any' type. |
| 33 | + ~~ |
| 34 | +!!! error TS7031: Binding element 'c2' implicitly has an 'any' type. |
| 35 | + let [a3 = <any>undefined, b3 = <any>null, c3 = <any>undefined] = [1, 2, 3]; // no error |
| 36 | + let [a4] = [<any>undefined], [b4] = [<any>null], c4 = <any>undefined, d4 = <any>null; // no error |
| 37 | + ~~ |
| 38 | +!!! error TS7031: Binding element 'a4' implicitly has an 'any' type. |
| 39 | + ~~ |
| 40 | +!!! error TS7031: Binding element 'b4' implicitly has an 'any' type. |
| 41 | + |
| 42 | + let {x, y, z} = { x: 1, y: 2, z: 3 }; // no error |
| 43 | + ~ |
| 44 | +!!! error TS7031: Binding element 'x' implicitly has an 'any' type. |
| 45 | + ~ |
| 46 | +!!! error TS7031: Binding element 'y' implicitly has an 'any' type. |
| 47 | + ~ |
| 48 | +!!! error TS7031: Binding element 'z' implicitly has an 'any' type. |
| 49 | + let {x1 = 10, y1 = 10, z1 = 10} = { x1: 1, y1: 2, z1: 3 }; // no error |
| 50 | + let {x2 = undefined, y2 = undefined, z2 = undefined} = { x2: 1, y2: 2, z2: 3 }; // no error |
| 51 | + ~~ |
| 52 | +!!! error TS7031: Binding element 'x2' implicitly has an 'any' type. |
| 53 | + ~~ |
| 54 | +!!! error TS7031: Binding element 'y2' implicitly has an 'any' type. |
| 55 | + ~~ |
| 56 | +!!! error TS7031: Binding element 'z2' implicitly has an 'any' type. |
| 57 | + let {x3 = <any>undefined, y3 = <any>null, z3 = <any>undefined} = { x3: 1, y3: 2, z3: 3 }; // no error |
| 58 | + let {x4} = { x4: <any>undefined }, {y4} = { y4: <any>null }; // no error |
| 59 | + ~~ |
| 60 | +!!! error TS7031: Binding element 'x4' implicitly has an 'any' type. |
| 61 | + ~~ |
| 62 | +!!! error TS7031: Binding element 'y4' implicitly has an 'any' type. |
| 63 | + |
0 commit comments