Given the following code (linkground link: http://bit.ly/1n7Fcow )
declare function pick<T, V>(f:(x:T, y:V) => V):V; declare function pick<T, V>(f:(x:T, y:V) => T):T; var xx = pick((x: number, y:string) => x); var yy = pick((x: number, y:string) => y);
TypeScript selects the wrong overload and does not output the xx type.
Is it possible to make typescript select the correct overload there?
Note: to avoid the XY problem, this is the original problem - http://bit.ly/QXaQGc - I need such an overload to be able to model promises correctly.
source share