test.js(3,17): error TS2322: Type 'number' is not assignable to type 'string'.
test.js(5,14): error TS2322: Type 'number' is not assignable to type 'string'.
test.js(7,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x: number) => string'.
  Type 'number' is not assignable to type 'string'.
test.js(10,17): error TS2322: Type 'number' is not assignable to type 'string'.
test.js(12,14): error TS2322: Type 'number' is not assignable to type 'string'.
test.js(14,5): error TS2322: Type '(x: number) => number' is not assignable to type '(x: number) => string'.
  Type 'number' is not assignable to type 'string'.
test.js(28,12): error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments.
test.js(34,5): error TS2322: Type '1 | 2' is not assignable to type '2 | 3'.
  Type '1' is not assignable to type '2 | 3'.


==== test.js (8 errors) ====
    // all 6 should error on return statement/expression
    /** @type {(x: number) => string} */
    function h(x) { return x }
                    ~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    /** @type {(x: number) => string} */
    var f = x => x
                 ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 test.js:4:12: The expected type comes from the return type of this signature.
    /** @type {(x: number) => string} */
    var g = function (x) { return x }
        ~
!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: number) => string'.
!!! error TS2322:   Type 'number' is not assignable to type 'string'.
    
    /** @type {{ (x: number): string }} */
    function i(x) { return x }
                    ~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    /** @type {{ (x: number): string }} */
    var j = x => x
                 ~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
!!! related TS6502 test.js:11:12: The expected type comes from the return type of this signature.
    /** @type {{ (x: number): string }} */
    var k = function (x) { return x }
        ~
!!! error TS2322: Type '(x: number) => number' is not assignable to type '(x: number) => string'.
!!! error TS2322:   Type 'number' is not assignable to type 'string'.
    
    
    /** @typedef {(x: 'hi' | 'bye') => 0 | 1 | 2} Argle */
    /** @type {Argle} */
    function blargle(s) {
        return 0;
    }
    
    /** @type {0 | 1 | 2} - assignment should not error */
    var zeroonetwo = blargle('hi')
    
    /** @typedef {{(s: string): 0 | 1; (b: boolean): 2 | 3 }} Gioconda */
    
    /** @type {Gioconda} */
               ~~~~~~~~
!!! error TS8030: A JSDoc '@type' tag on a function must have a signature with the correct number of arguments.
    function monaLisa(sb) {
        return typeof sb === 'string' ? 1 : 2;
    }
    
    /** @type {2 | 3} - overloads are not supported, so there will be an error */
    var twothree = monaLisa(false);
        ~~~~~~~~
!!! error TS2322: Type '1 | 2' is not assignable to type '2 | 3'.
!!! error TS2322:   Type '1' is not assignable to type '2 | 3'.
    