Closed
Description
TypeScript Version: nightly (2.4.0-dev.20170502)
TypeScript improperly infers a union type when a generic function is used as an argument. Such an inference is unexpected unless the union constituent is present, or the type arguments are manually provided by the programmer.
Code
declare function sameType<T>(x: T, y: T): T;
declare function test<R>(f: (x: string, y: number) => R): void;
test(sameType); // bad inference: R = string | number