=== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithFunctionTypedArguments.ts ===
// 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) {
>foo : <T>(x: (a: T) => T) => T
>x : (a: T) => T
>a : T

    return x(null);
>x(null) : T
>x : (a: T) => T
>null : null
}

var r = foo(<U>(x: U) => ''); // {}
>r : unknown
>foo(<U>(x: U) => '') : unknown
>foo : <T>(x: (a: T) => T) => T
><U>(x: U) => '' : <U>(x: U) => string
>x : U
>'' : ""

var r2 = foo<string>(<U>(x: U) => ''); // string 
>r2 : string
>foo<string>(<U>(x: U) => '') : string
>foo : <T>(x: (a: T) => T) => T
><U>(x: U) => '' : <U>(x: U) => string
>x : U
>'' : ""

var r3 = foo(x => ''); // {}
>r3 : unknown
>foo(x => '') : unknown
>foo : <T>(x: (a: T) => T) => T
>x => '' : (x: unknown) => string
>x : unknown
>'' : ""

function foo2<T, U>(x: T, cb: (a: T) => U) {
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>x : T
>cb : (a: T) => U
>a : T

    return cb(x);
>cb(x) : U
>cb : (a: T) => U
>x : T
}

var r4 = foo2(1, function <Z>(a: Z) { return '' }); // string, contextual signature instantiation is applied to generic functions
>r4 : string
>foo2(1, function <Z>(a: Z) { return '' }) : string
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>1 : 1
>function <Z>(a: Z) { return '' } : <Z>(a: Z) => string
>a : Z
>'' : ""

var r5 = foo2(1, (a) => ''); // string
>r5 : string
>foo2(1, (a) => '') : string
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>1 : 1
>(a) => '' : (a: number) => string
>a : number
>'' : ""

var r6 = foo2<string, number>('', <Z>(a: Z) => 1);
>r6 : number
>foo2<string, number>('', <Z>(a: Z) => 1) : number
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>'' : ""
><Z>(a: Z) => 1 : <Z>(a: Z) => number
>a : Z
>1 : 1

function foo3<T, U>(x: T, cb: (a: T) => U, y: U) {
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>x : T
>cb : (a: T) => U
>a : T
>y : U

    return cb(x);
>cb(x) : U
>cb : (a: T) => U
>x : T
}

var r7 = foo3(1, <Z>(a: Z) => '', ''); // string
>r7 : string
>foo3(1, <Z>(a: Z) => '', '') : string
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
><Z>(a: Z) => '' : <Z>(a: Z) => string
>a : Z
>'' : ""
>'' : ""

var r8 = foo3(1, function (a) { return '' }, 1); // error
>r8 : number
>foo3(1, function (a) { return '' }, 1) : 1
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
>function (a) { return '' } : (a: number) => string
>a : number
>'' : ""
>1 : 1

var r9 = foo3<number, string>(1, (a) => '', ''); // string
>r9 : string
>foo3<number, string>(1, (a) => '', '') : string
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
>(a) => '' : (a: number) => string
>a : number
>'' : ""
>'' : ""

function other<T, U>(t: T, u: U) {
>other : <T, U>(t: T, u: U) => void
>t : T
>u : U

    var r10 = foo2(1, (x: T) => ''); // error
>r10 : string
>foo2(1, (x: T) => '') : string
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>1 : 1
>(x: T) => '' : (x: T) => string
>x : T
>'' : ""

    var r10 = foo2(1, (x) => ''); // string
>r10 : string
>foo2(1, (x) => '') : string
>foo2 : <T, U>(x: T, cb: (a: T) => U) => U
>1 : 1
>(x) => '' : (x: number) => string
>x : number
>'' : ""

    var r11 = foo3(1, (x: T) => '', ''); // error
>r11 : string
>foo3(1, (x: T) => '', '') : string
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
>(x: T) => '' : (x: T) => string
>x : T
>'' : ""
>'' : ""

    var r11b = foo3(1, (x: T) => '', 1); // error
>r11b : string
>foo3(1, (x: T) => '', 1) : string
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
>(x: T) => '' : (x: T) => string
>x : T
>'' : ""
>1 : 1

    var r12 = foo3(1, function (a) { return '' }, 1); // error
>r12 : number
>foo3(1, function (a) { return '' }, 1) : 1
>foo3 : <T, U>(x: T, cb: (a: T) => U, y: U) => U
>1 : 1
>function (a) { return '' } : (a: number) => string
>a : number
>'' : ""
>1 : 1
}
