typeGuardsInWhileStatement.ts(5,9): error TS2322: Type 'undefined' is not assignable to type 'string | number'.
typeGuardsInWhileStatement.ts(13,9): error TS2322: Type 'undefined' is not assignable to type 'string | number'.
typeGuardsInWhileStatement.ts(21,9): error TS2322: Type 'undefined' is not assignable to type 'string | number'.


==== typeGuardsInWhileStatement.ts (3 errors) ====
    let cond: boolean;
    function a(x: string | number) {
        while (typeof x === "string") {
            x; // string
            x = undefined;
            ~
!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'.
        }
        x; // number
    }
    function b(x: string | number) {
        while (typeof x === "string") {
            if (cond) continue;
            x; // string
            x = undefined;
            ~
!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'.
        }
        x; // number
    }
    function c(x: string | number) {
        while (typeof x === "string") {
            if (cond) break;
            x; // string
            x = undefined;
            ~
!!! error TS2322: Type 'undefined' is not assignable to type 'string | number'.
        }
        x; // string | number
    }
    