noInferUnionExcessPropertyCheck1.ts(7,33): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'NoInfer<{ x: string; }> | (() => NoInfer<{ x: string; }>)'.
noInferUnionExcessPropertyCheck1.ts(15,33): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'NoInfer<{ x: string; }> | NoInfer<() => { x: string; }>'.
noInferUnionExcessPropertyCheck1.ts(23,33): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; } | (() => { x: string; })'.


==== noInferUnionExcessPropertyCheck1.ts (3 errors) ====
    declare function test1<T extends { x: string }>(
      a: T,
      b: NoInfer<T> | (() => NoInfer<T>),
    ): void;
    
    test1({ x: "foo" }, { x: "bar" }); // no error
    test1({ x: "foo" }, { x: "bar", y: 42 }); // epc error
                                    ~
!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'NoInfer<{ x: string; }> | (() => NoInfer<{ x: string; }>)'.
    
    declare function test2<T extends { x: string }>(
      a: T,
      b: NoInfer<T> | NoInfer<() => T>,
    ): void;
    
    test2({ x: "foo" }, { x: "bar" }); // no error
    test2({ x: "foo" }, { x: "bar", y: 42 }); // epc error
                                    ~
!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type 'NoInfer<{ x: string; }> | NoInfer<() => { x: string; }>'.
    
    declare function test3<T extends { x: string }>(
      a: T,
      b: NoInfer<T | (() => T)>,
    ): void;
    
    test3({ x: "foo" }, { x: "bar" }); // no error
    test3({ x: "foo" }, { x: "bar", y: 42 }); // epc error
                                    ~
!!! error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: string; } | (() => { x: string; })'.
    