tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(2,13): error TS2448: Block-scoped variable 'x' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(58,20): error TS2448: Block-scoped variable 'x' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(65,20): error TS2448: Block-scoped variable 'x' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(100,12): error TS2448: Block-scoped variable 'x' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(111,28): error TS2448: Block-scoped variable 'a' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(112,21): error TS2448: Block-scoped variable 'a' used before its declaration.
tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(122,22): error TS2448: Block-scoped variable 'a' used before its declaration.


==== tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts (7 errors) ====
    function foo0() {
        let a = x;
                ~
!!! error TS2448: Block-scoped variable 'x' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:3:9: 'x' is declared here.
        let x;
    }
    
    function foo1() {
        let a = () => x;
        let x;
    }
    
    function foo2() {
        let a = function () { return x; }
        let x;
    }
    
    function foo3() {
        class X {
            m() { return x;}
        }
        let x;
    }
    
    function foo4() {
        let y = class {
            m() { return x; }
        };
        let x;
    }
    
    function foo5() {
        let x = () => y;
        let y = () => x;
    }
    
    function foo6() {
        function f() {
            return x;
        }
        let x;
    }
    
    function foo7() {
        class A {
            a = x;
        }
        let x;
    }
    
    function foo8() {
        let y = class {
            a = x;
        }
        let x;
    }
    
    function foo9() {
        let y = class {
            static a = x;
                       ~
!!! error TS2448: Block-scoped variable 'x' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:60:9: 'x' is declared here.
        }
        let x;
    }
    
    function foo10() {
        class A {
            static a = x;
                       ~
!!! error TS2448: Block-scoped variable 'x' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:67:9: 'x' is declared here.
        }
        let x;
    }
    
    function foo11() {
        function f () {
            let y = class {
                static a = x;
            }
        }
        let x;
    }
    
    function foo12() {
        function f () {
            let y = class {
                a;
                constructor() {
                    this.a = x;
                }
            }
        }
        let x;
    }
    
    function foo13() {
        let a = {
            get a() { return x } 
        }
        let x
    }
    
    function foo14() {
        let a = {
            a: x 
               ~
!!! error TS2448: Block-scoped variable 'x' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:102:9: 'x' is declared here.
        }
        let x
    }
    
    function foo15() {
        // https://github.com/microsoft/TypeScript/issues/42678
        const [
            a,
            b,
        ] = ((): [number, number] => {
            (() => console.log(a))();  // should error
                               ~
!!! error TS2448: Block-scoped variable 'a' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:108:9: 'a' is declared here.
            console.log(a);            // should error
                        ~
!!! error TS2448: Block-scoped variable 'a' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:108:9: 'a' is declared here.
            const b = () => a;         // should be ok
            return [
                0,
                0,
            ];
        })();    
    }
    
    function foo16() {
        let [a] = (() => a)();
                         ~
!!! error TS2448: Block-scoped variable 'a' used before its declaration.
!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:122:10: 'a' is declared here.
    }
    
    function foo17() {
        const promise = (async () => {
            promise
            foo
            await null
            promise
            foo
        })()
    
        const foo = 1;
    }
    