genericCallWithConstructorTypedArguments5.ts(4,23): 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'.
genericCallWithConstructorTypedArguments5.ts(11,14): error TS2345: Argument of type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'.
  Types of property 'cb' are incompatible.
    Type 'new <T>(x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'.
      Target signature provides too few arguments. Expected 2 or more, but got 1.
genericCallWithConstructorTypedArguments5.ts(13,14): error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'.
  Types of property 'cb' are incompatible.
    Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'.
      Target signature provides too few arguments. Expected 2 or more, but got 1.
genericCallWithConstructorTypedArguments5.ts(16,23): 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'.


==== genericCallWithConstructorTypedArguments5.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: new(t: T) => U }) {
        return new 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'.
    }
    
    declare var arg: { cb: new<T>(x: T) => string };
    var r = foo(arg); // {}
    // more args not allowed
    declare var arg2: { cb: new <T>(x: T, y: T) => string };
    var r2 = foo(arg2); // error
                 ~~~~
!!! error TS2345: Argument of type '{ cb: new <T>(x: T, y: T) => string; }' is not assignable to parameter of type '{ cb: new (t: unknown) => string; }'.
!!! error TS2345:   Types of property 'cb' are incompatible.
!!! error TS2345:     Type 'new <T>(x: T, y: T) => string' is not assignable to type 'new (t: unknown) => string'.
!!! error TS2345:       Target signature provides too few arguments. Expected 2 or more, but got 1.
    declare var arg3: { cb: new (x: string, y: number) => string };
    var r3 = foo(arg3); // error
                 ~~~~
!!! error TS2345: Argument of type '{ cb: new (x: string, y: number) => string; }' is not assignable to parameter of type '{ cb: new (t: string) => string; }'.
!!! error TS2345:   Types of property 'cb' are incompatible.
!!! error TS2345:     Type 'new (x: string, y: number) => string' is not assignable to type 'new (t: string) => string'.
!!! error TS2345:       Target signature provides too few arguments. Expected 2 or more, but got 1.
    
    function foo2<T, U>(arg: { cb: new(t: T, t2: T) => U }) {
        return new 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); // {}
    declare var arg4: { cb: new (x: string) => string };
    var r6 = foo(arg4); // string
    declare var arg5: { cb: new () => string };
    var r7 = foo(arg5); // string
    