tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(12,17): error TS6133: 'b1' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(13,12): error TS6133: 'a2' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(14,12): error TS6133: 'a3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(14,16): error TS6133: 'b3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(23,12): error TS6133: 'a3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(23,18): error TS6133: 'b3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(23,22): error TS6133: 'c3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(23,28): error TS6133: 'd3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(23,32): error TS6133: 'e3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(37,22): error TS6133: 'b1' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(38,13): error TS6133: 'a2' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(39,11): error TS6198: All destructured elements are unused.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(68,9): error TS6133: 'a3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(70,18): error TS6198: All destructured elements are unused.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(74,9): error TS6133: 'c3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(75,9): error TS6133: 'd3' is declared but its value is never read.
tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts(81,11): error TS6198: All destructured elements are unused.


==== tests/cases/compiler/unusedVariablesWithUnderscoreInBindingElement.ts (17 errors) ====
    function t1() {
        const [_a1, b1] = [1, 2];
        console.log(b1);
    
        const [a2, _b2] = [1, 2];
        console.log(a2);
    
        const [_a3, _b3] = [1, 2];
    }
    
    function t2() {
        const [_a1, b1] = [1, 2];
                    ~~
!!! error TS6133: 'b1' is declared but its value is never read.
        const [a2, _b2] = [1, 2];
               ~~
!!! error TS6133: 'a2' is declared but its value is never read.
        const [a3, b3] = [1, 2];
               ~~
!!! error TS6133: 'a3' is declared but its value is never read.
                   ~~
!!! error TS6133: 'b3' is declared but its value is never read.
    }
    
    function t3() {
        const [_a1, [[_b1, c1]], d1, _e1] = [1, [[2, 3]], 4, 5];
        console.log(c1, d1);
    
        const [_a2, [[_b2, _c2]], _d2, _e2] = [1, [[2, 3]], 4, 5];
    
        const [a3, [[b3, c3]], d3, e3] = [1, [[2, 3]], 4, 5];
               ~~
!!! error TS6133: 'a3' is declared but its value is never read.
                     ~~
!!! error TS6133: 'b3' is declared but its value is never read.
                         ~~
!!! error TS6133: 'c3' is declared but its value is never read.
                               ~~
!!! error TS6133: 'd3' is declared but its value is never read.
                                   ~~
!!! error TS6133: 'e3' is declared but its value is never read.
    }
    
    function t4() {
        const { a1: _a1, b1 } = { a1: 1, b1: 1 };
        console.log(b1);
    
        const { a2, b2: _b2 } = { a2: 1, b2: 1 };
        console.log(a2);
    
        const { a3: _a3, b3: _b3 } = { a3: 1, b3: 1 };
    }
    
    function t5() {
        const { a1: _a1, b1 } = { a1: 1, b1: 1 };
                         ~~
!!! error TS6133: 'b1' is declared but its value is never read.
        const { a2, b2: _b2 } = { a2: 1, b2: 1 };
                ~~
!!! error TS6133: 'a2' is declared but its value is never read.
        const { a3, b3 } = { a3: 1, b3: 1 };
              ~~~~~~~~~~
!!! error TS6198: All destructured elements are unused.
    }
    
    function t6() {
        const {
            a1: _a1,
            b1: {
                b11: {
                    b111: _b111,
                    b112
                }
            },
            c1,
            d1: _d1
        } = { a1: 1, b1: { b11: { b111: 1, b112: 1 } }, c1: 1, d1: 1 };
        console.log(b112, c1);
    
        const {
            a2: _a2,
            b2: {
                b21: {
                    b211: _b211, b212: _b212
                }
            },
            c2: _c2,
            d2: _d2
        } = { a2: 1, b2: { b21: { b211: 1, b212: 1 } }, c2: 1, d2: 1 };
    
        const {
            a3,
            ~~
!!! error TS6133: 'a3' is declared but its value is never read.
            b3: {
                b31: {
                     ~
                    b311, b312
    ~~~~~~~~~~~~~~~~~~~~~~~~~~
                }
    ~~~~~~~~~~~~~
!!! error TS6198: All destructured elements are unused.
            },
            c3,
            ~~
!!! error TS6133: 'c3' is declared but its value is never read.
            d3
            ~~
!!! error TS6133: 'd3' is declared but its value is never read.
        } = { a3: 1, b3: { b31: { b311: 1, b312: 1 } }, c3: 1, d3: 1 };
    }
    
    function t7() {
        // error
        const { _a1, _b1 } = { _a1: 1, _b1: 1 };
              ~~~~~~~~~~~~
!!! error TS6198: All destructured elements are unused.
    
        // ok
        const { a2: _a2, b2: _b2 } = { a2: 1, b2: 1 };
    
        // ok
        const { _a3: _ignoreA3, _b3: _ignoreB3 } = { _a3: 1, _b3: 1 };
    }
    