==== tests/cases/conformance/types/typeParameters/typeArgumentLists/functionConstraintSatisfaction2.ts (14 errors) ==== // satisfaction of a constraint to Function, all of these invocations are errors unless otherwise noted function foo(x: T): T { return x; } foo(1); ~ !!! Argument of type 'number' is not assignable to parameter of type 'Function'. foo(() => { }, 1); ~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. foo(1, () => { }); ~~~~~~~~~~~~~~~~~ !!! Supplied parameters do not match any signature of call target. function foo2 string>(x: T): T { return x; } class C { foo: string; } var b: { new (x: string): string }; class C2 { foo: T; } var b2: { new (x: T): T }; var r = foo2(new Function()); ~~~~~~~~~~~~~~ !!! Argument of type 'Function' is not assignable to parameter of type '(x: string) => string'. var r2 = foo2((x: string[]) => x); ~~~~~~~~~~~~~~~~~~ !!! Argument of type '(x: string[]) => string[]' is not assignable to parameter of type '(x: string) => string'. var r6 = foo2(C); ~ !!! Argument of type 'typeof C' is not assignable to parameter of type '(x: string) => string'. var r7 = foo2(b); ~ !!! Argument of type 'new (x: string) => string' is not assignable to parameter of type '(x: string) => string'. var r8 = foo2((x: U) => x); // no error expected var r11 = foo2((x: U, y: V) => x); ~~~~~~~~~~~~~~~~~~~~~~~ !!! Argument of type '(x: U, y: V) => U' is not assignable to parameter of type '(x: string) => string'. var r13 = foo2(C2); ~~ !!! Argument of type 'typeof C2' is not assignable to parameter of type '(x: string) => string'. var r14 = foo2(b2); ~~ !!! Argument of type 'new (x: T) => T' is not assignable to parameter of type '(x: string) => string'. interface F2 extends Function { foo: string; } var f2: F2; var r16 = foo2(f2); ~~ !!! Argument of type 'F2' is not assignable to parameter of type '(x: string) => string'. function fff(x: T, y: U) { ~~~~~~~~~~~ !!! Constraint of a type parameter cannot reference any type parameter from the same type parameter list. foo2(x); ~ !!! Argument of type 'T' is not assignable to parameter of type '(x: string) => string'. foo2(y); ~ !!! Argument of type 'U' is not assignable to parameter of type '(x: string) => string'. }