TypeScript/tests/baselines/reference/contextualTypingOfGenericFunctionTypedArguments1.errors.txt
2014-07-12 17:30:19 -07:00

23 lines
No EOL
877 B
Text

==== tests/cases/compiler/contextualTypingOfGenericFunctionTypedArguments1.ts (2 errors) ====
interface Collection<T> {
length: number;
add(x: T): void;
remove(x: T): boolean;
}
interface Combinators {
forEach<T>(c: Collection<T>, f: (x: T) => Date): void;
}
var c2: Collection<number>;
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<number>(c2, f);
~~~~~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.
var r6 = _.forEach<number>(c2, (x) => { return x.toFixed() });
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! Supplied parameters do not match any signature of call target.