=== tests/cases/compiler/callbacksDontShareTypes.ts === interface Collection { >Collection : Collection >T : T length: number; >length : number add(x: T): void; >add : (x: T) => void >x : T >T : T remove(x: T): boolean; >remove : (x: T) => boolean >x : T >T : T } interface Combinators { >Combinators : Combinators map(c: Collection, f: (x: T) => U): Collection; >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >T : T >U : U >c : Collection >Collection : Collection >T : T >f : (x: T) => U >x : T >T : T >U : U >Collection : Collection >U : U map(c: Collection, f: (x: T) => any): Collection; >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >T : T >c : Collection >Collection : Collection >T : T >f : (x: T) => any >x : T >T : T >Collection : Collection } var _: Combinators; >_ : Combinators >Combinators : Combinators var c2: Collection; >c2 : Collection >Collection : Collection var rf1 = (x: number) => { return x.toFixed() }; >rf1 : (x: number) => string >(x: number) => { return x.toFixed() } : (x: number) => string >x : number >x.toFixed() : string >x.toFixed : (fractionDigits?: number) => string >x : number >toFixed : (fractionDigits?: number) => string var r1a = _.map(c2, (x) => { return x.toFixed() }); >r1a : Collection >_.map(c2, (x) => { return x.toFixed() }) : Collection >_.map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >c2 : Collection >(x) => { return x.toFixed() } : (x: number) => string >x : number >x.toFixed() : string >x.toFixed : (fractionDigits?: number) => string >x : number >toFixed : (fractionDigits?: number) => string var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors >r1b : Collection >_.map(c2, rf1) : Collection >_.map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >c2 : Collection >rf1 : (x: number) => string var r5a = _.map(c2, (x) => { return x.toFixed() }); >r5a : Collection >_.map(c2, (x) => { return x.toFixed() }) : Collection >_.map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >c2 : Collection >(x) => { return x.toFixed() } : (x: number) => string >x : number >x.toFixed() : string >x.toFixed : (fractionDigits?: number) => string >x : number >toFixed : (fractionDigits?: number) => string var r5b = _.map(c2, rf1); >r5b : Collection >_.map(c2, rf1) : Collection >_.map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >_ : Combinators >map : { (c: Collection, f: (x: T) => U): Collection; (c: Collection, f: (x: T) => any): Collection; } >c2 : Collection >rf1 : (x: number) => string