tests/cases/conformance/jsdoc/assertionsAndNonReturningFunctions.js(46,9): error TS7027: Unreachable code detected.
tests/cases/conformance/jsdoc/assertionsAndNonReturningFunctions.js(58,5): error TS7027: Unreachable code detected.


==== tests/cases/conformance/jsdoc/assertionsAndNonReturningFunctions.js (2 errors) ====
    /** @typedef {(check: boolean) => asserts check} AssertFunc */
    
    /** @type {AssertFunc} */
    const assert = check => {
        if (!check) throw new Error();
    }
    
    /** @type {(x: unknown) => asserts x is string } */
    function assertIsString(x) {
        if (!(typeof x === "string")) throw new Error();
    }
    
    /**
     * @param {boolean} check
     * @returns {asserts check}
    */
    function assert2(check) {
        if (!check) throw new Error();
    }
    
    /**
     * @returns {never}
     */
    function fail() {
        throw new Error();
    }
    
    /**
     * @param {*} x 
     */
    function f1(x) {
        if (!!true) {
            assert(typeof x === "string");
            x.length;
        }
        if (!!true) {
            assert2(typeof x === "string");
            x.length;
        }
        if (!!true) {
            assertIsString(x);
            x.length;
        }
        if (!!true) {
            fail();
            x;  // Unreachable
            ~~
!!! error TS7027: Unreachable code detected.
        }
    }
    
    /**
     * @param {boolean} b 
     */
    function f2(b) {
        switch (b) {
            case true: return 1;
            case false: return 0;
        }
        b;  // Unreachable
        ~~
!!! error TS7027: Unreachable code detected.
    }
    