nestedLoopTypeGuards.ts(5,16): error TS2454: Variable 'a' is used before being assigned.
nestedLoopTypeGuards.ts(9,24): error TS2454: Variable 'a' is used before being assigned.
nestedLoopTypeGuards.ts(21,16): error TS2454: Variable 'a' is used before being assigned.


==== nestedLoopTypeGuards.ts (3 errors) ====
    // Repros from #10378
    
    function f1() {
        var a: boolean | number | string;
        if (typeof a !== 'boolean') {
                   ~
!!! error TS2454: Variable 'a' is used before being assigned.
            // a is narrowed to "number | string"
            for (var i = 0; i < 1; i++) {
                for (var j = 0; j < 1; j++) {}
                if (typeof a === 'string') {
                           ~
!!! error TS2454: Variable 'a' is used before being assigned.
                    // a is narrowed to "string'
                    for (var j = 0; j < 1; j++) {
                        a.length; // Should not error here
                    }
                }
            }
        }
    }
    
    function f2() {
        var a: string | number;
        if (typeof a === 'string') {
                   ~
!!! error TS2454: Variable 'a' is used before being assigned.
            while (1) {
                while (1) {}
                if (typeof a === 'string') {
                    while (1) {
                        a.length; // Should not error here
                    }
                }
            }
        }
    }