tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(16,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. Property 'toDateString' is missing in type 'String'. tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts(17,32): error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. Type 'string' is not assignable to type 'Date'. ==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ==== interface Collection { length: number; add(x: T): void; remove(x: T): boolean; } interface Combinators { forEach(c: Collection, f: (x: T) => Date): void; } var c2: Collection; var _: Combinators; // errors on all 3 lines, bug was that r5 was the only line with errors var f = (x: number) => { return x.toFixed() }; var r5 = _.forEach(c2, f); ~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'. !!! error TS2345: Property 'toDateString' is missing in type 'String'. var r6 = _.forEach(c2, (x) => { return x.toFixed() }); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '(x: number) => string' is not assignable to parameter of type '(x: number) => Date'. !!! error TS2345: Type 'string' is not assignable to type 'Date'.