index.js(3,3): error TS2322: Type 'number' is not assignable to type 'string'.
index.js(20,16): error TS2322: Type '"other"' is not assignable to type '"foo" | "bar"'.


==== index.js (2 errors) ====
    /** @type () => string */
    function fn1() {
      return 42;
      ~~~~~~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
    }
    
    /** @type () => string */
    function fn2() {
      return "foo";
    }
    
    /** @type (arg: string) => string */
    function fn3(arg) {
      return arg;
    }
    
    /** @type ({ type: 'foo' } | { type: 'bar' }) & { prop: number } */
    const obj1 = { type: "foo", prop: 10 };
    
    /** @type ({ type: 'foo' } | { type: 'bar' }) & { prop: number } */
    const obj2 = { type: "other", prop: 10 };
                   ~~~~
!!! error TS2322: Type '"other"' is not assignable to type '"foo" | "bar"'.
!!! related TS6500 index.js:19:14: The expected type comes from property 'type' which is declared here on type '({ type: "foo"; } | { type: "bar"; }) & { prop: number; }'
    