genericCallWithFunctionTypedArguments.ts(5,14): 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'.
genericCallWithFunctionTypedArguments.ts(26,18): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
  Type 'string' is not assignable to type '1'.
genericCallWithFunctionTypedArguments.ts(30,20): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
genericCallWithFunctionTypedArguments.ts(33,20): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
genericCallWithFunctionTypedArguments.ts(34,21): error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
genericCallWithFunctionTypedArguments.ts(35,23): error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
  Type 'string' is not assignable to type '1'.


==== genericCallWithFunctionTypedArguments.ts (6 errors) ====
    // Generic functions used as arguments for function typed parameters are not used to make inferences from
    // Using function arguments, no errors expected
    
    function foo<T>(x: (a: T) => T) {
        return x(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 r = foo(<U>(x: U) => ''); // {}
    var r2 = foo<string>(<U>(x: U) => ''); // string 
    var r3 = foo(x => ''); // {}
    
    function foo2<T, U>(x: T, cb: (a: T) => U) {
        return cb(x);
    }
    
    var r4 = foo2(1, function <Z>(a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions
    var r5 = foo2(1, (a) => ''); // string
    var r6 = foo2<string, number>('', <Z>(a: Z) => 1);
    
    function foo3<T, U>(x: T, cb: (a: T) => U, y: U) {
        return cb(x);
    }
    
    var r7 = foo3(1, <Z>(a: Z) => '', ''); // string
    
    var r8 = foo3(1, function (a) { return '' }, 1); // error
                     ~~~~~~~~
!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
!!! error TS2345:   Type 'string' is not assignable to type '1'.
    var r9 = foo3<number, string>(1, (a) => '', ''); // string
    
    function other<T, U>(t: T, u: U) {
        var r10 = foo2(1, (x: T) => ''); // error
                       ~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
!!! error TS2345:   'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
        var r10 = foo2(1, (x) => ''); // string
    
        var r11 = foo3(1, (x: T) => '', ''); // error
                       ~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
!!! error TS2345:   'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
        var r11b = foo3(1, (x: T) => '', 1); // error
                        ~
!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'T'.
!!! error TS2345:   'T' could be instantiated with an arbitrary type which could be unrelated to 'number'.
        var r12 = foo3(1, function (a) { return '' }, 1); // error
                          ~~~~~~~~
!!! error TS2345: Argument of type '(a: number) => string' is not assignable to parameter of type '(a: number) => 1'.
!!! error TS2345:   Type 'string' is not assignable to type '1'.
    }