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