//// [genericFunctionsWithOptionalParameters3.ts] class Collection { public add(x: T) { } } interface Utils { fold(c?: Collection, folder?: (s: S, t: T) => T, init?: S): T; mapReduce(c: Collection, mapper: (x: T) => U, reducer: (y: U) => V): Collection; } var utils: Utils; var c = new Collection(); var r3 = utils.mapReduce(c, (x) => { return 1 }, (y) => { return new Date() }); var r4 = utils.mapReduce(c, (x: string) => { return 1 }, (y: number) => { return new Date() }); var f1 = (x: string) => { return 1 }; var f2 = (y: number) => { return new Date() }; var r5 = utils.mapReduce(c, f1, f2); //// [genericFunctionsWithOptionalParameters3.js] var Collection = (function () { function Collection() { } Collection.prototype.add = function (x) { }; return Collection; })(); var utils; var c = new Collection(); var r3 = utils.mapReduce(c, function (x) { return 1; }, function (y) { return new Date(); }); var r4 = utils.mapReduce(c, function (x) { return 1; }, function (y) { return new Date(); }); var f1 = function (x) { return 1; }; var f2 = function (y) { return new Date(); }; var r5 = utils.mapReduce(c, f1, f2);