genericCallWithFunctionTypedArguments5.ts(4,19): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
genericCallWithFunctionTypedArguments5.ts(10,16): error TS2322: Type '<T>(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'.
  Target signature provides too few arguments. Expected 2 or more, but got 1.
genericCallWithFunctionTypedArguments5.ts(11,16): error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'.
  Target signature provides too few arguments. Expected 2 or more, but got 1.
genericCallWithFunctionTypedArguments5.ts(14,19): error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.


==== genericCallWithFunctionTypedArguments5.ts (4 errors) ====
    // Generic call with parameter of object type with member of function type of n args passed object whose associated member is call signature with n+1 args
    
    function foo<T, U>(arg: { cb: (t: T) => U }) {
        return arg.cb(null);
                      ~~~~
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
!!! error TS2345:   'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
    }
    
    var arg = { cb: <T>(x: T) => '' };
    var r = foo(arg); // {}
    // more args not allowed
    var r2 = foo({ cb: <T>(x: T, y: T) => '' }); // error
                   ~~
!!! error TS2322: Type '<T>(x: T, y: T) => string' is not assignable to type '(t: unknown) => string'.
!!! error TS2322:   Target signature provides too few arguments. Expected 2 or more, but got 1.
!!! related TS6500 genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: unknown) => string; }'
    var r3 = foo({ cb: (x: string, y: number) => '' }); // error
                   ~~
!!! error TS2322: Type '(x: string, y: number) => string' is not assignable to type '(t: string) => string'.
!!! error TS2322:   Target signature provides too few arguments. Expected 2 or more, but got 1.
!!! related TS6500 genericCallWithFunctionTypedArguments5.ts:3:27: The expected type comes from property 'cb' which is declared here on type '{ cb: (t: string) => string; }'
    
    function foo2<T, U>(arg: { cb: (t: T, t2: T) => U }) {
        return arg.cb(null, null);
                      ~~~~
!!! error TS2345: Argument of type 'null' is not assignable to parameter of type 'T'.
!!! error TS2345:   'T' could be instantiated with an arbitrary type which could be unrelated to 'null'.
    }
    
    // fewer args ok
    var r4 = foo(arg); // {}
    var r5 = foo({ cb: <T>(x: T) => '' }); // {}
    var r6 = foo({ cb: (x: string) => '' }); // string
    var r7 = foo({ cb: () => '' }); // string
    