==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithOverloadedFunctionTypedArguments2.ts (1 errors) ==== // Function typed arguments with multiple signatures must be passed an implementation that matches all of them // Inferences are made quadratic-pairwise to and from these overload sets module NonGenericParameter { var a: { (x: boolean): boolean; (x: string): string; } function foo4(cb: typeof a) { return cb; } var r3 = foo4((x: T) => { var r: U; return r }); // ok } module GenericParameter { function foo5(cb: { (x: T): string; (x: number): T }) { return cb; } var r6 = foo5((x: T) => x); // ok function foo6(cb: { (x: T): string; (x: T, y?: T): string }) { return cb; } var r10 = foo6((x: T, y: T) => ''); // error ~~~~~~~~~~~~~~~~~~~~~ !!! Argument of type '(x: T, y: T) => string' is not assignable to parameter of type '{ (x: any): string; (x: any, y?: any): string; }'. function foo7(x:T, cb: { (x: T): string; (x: T, y?: T): string }) { return cb; } var r13 = foo7(1, (x: T) => x); // ok var a: { (x: T): number; (x: number): T; } var r14 = foo7(1, a); // ok }