1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
|
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(21,7): error TS2451: Cannot redeclare block-scoped variable 'foo1'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(21,13): error TS2451: Cannot redeclare block-scoped variable 'foo1'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(22,7): error TS2451: Cannot redeclare block-scoped variable 'foo2'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(22,19): error TS2451: Cannot redeclare block-scoped variable 'foo2'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(23,13): error TS2451: Cannot redeclare block-scoped variable 'foo3'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(23,19): error TS2451: Cannot redeclare block-scoped variable 'foo3'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(24,9): error TS2451: Cannot redeclare block-scoped variable 'foo4'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(24,15): error TS2451: Cannot redeclare block-scoped variable 'foo4'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(25,9): error TS2451: Cannot redeclare block-scoped variable 'foo5'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(25,21): error TS2451: Cannot redeclare block-scoped variable 'foo5'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(26,15): error TS2451: Cannot redeclare block-scoped variable 'foo6'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(26,21): error TS2451: Cannot redeclare block-scoped variable 'foo6'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(28,6): error TS2451: Cannot redeclare block-scoped variable 'blah1'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(28,13): error TS2451: Cannot redeclare block-scoped variable 'blah1'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(29,8): error TS2451: Cannot redeclare block-scoped variable 'blah2'.
tests/cases/conformance/es6/destructuring/destructuringSameNames.ts(29,15): error TS2451: Cannot redeclare block-scoped variable 'blah2'.
==== tests/cases/conformance/es6/destructuring/destructuringSameNames.ts (16 errors) ====
// Valid cases
let { foo, foo: bar } = { foo: 1 };
({ foo, foo } = { foo: 2 });
({ foo, foo: bar } = { foo: 3 });
({ foo: bar, foo } = { foo: 4 });
({ foo, bar: foo } = { foo: 3, bar: 33 });
({ bar: foo, foo } = { foo: 4, bar: 44 });
({ foo: bar, foo: bar } = { foo: 5 });
({ foo: bar, bar: foo } = { foo: 6, bar: 66 });
({ foo: bar, foo: bar } = { foo: 7 });
[foo, foo] = [111, 1111];
[foo, foo] = [222, 2222];
[bar, foo, foo] = [333, 3333, 33333];
[foo, bar, foo] = [333, 3333, 33333];
[foo, foo, bar] = [444, 4444, 44444];
// Error cases
let { foo1, foo1 } = { foo1: 10 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo1'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo1'.
let { foo2, bar2: foo2 } = { foo2: 20, bar2: 220 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo2'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo2'.
let { bar3: foo3, foo3 } = { foo3: 30, bar3: 330 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo3'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo3'.
const { foo4, foo4 } = { foo4: 40 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo4'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo4'.
const { foo5, bar5: foo5 } = { foo5: 50, bar5: 550 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo5'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo5'.
const { bar6: foo6, foo6 } = { foo6: 60, bar6: 660 };
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo6'.
~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'foo6'.
let [blah1, blah1] = [111, 222];
~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'blah1'.
~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'blah1'.
const [blah2, blah2] = [333, 444];
~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'blah2'.
~~~~~
!!! error TS2451: Cannot redeclare block-scoped variable 'blah2'.
|