-
Notifications
You must be signed in to change notification settings - Fork 12.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generic type inference failure with callbacks in 1.4 #1729
Comments
The issue here was introduced in 1.1. This was because of a change in design with overload resolution. When we do type argument inference, we have to relate the single signature of However, the new behavior is also incorrect. Now, when we infer from two signatures ( Ideally, we would want the second argument |
This is basically the same problem as #248 |
I think we've effectively given up on handling overloads in inference |
In 1.4.1.0 this snippet errors out with
changing line 8 to
... = call<string, number>(doit, 'here');
successfully compiles as expected.While playing around with this I noticed that while 1.3.0.0 would allow the
call(doit, 'here')
invocation it was still choosing the second overload ofdoit
resulting in a return type ofboolean
and causing a compile error on the assignment. I'm glad 1.4.1.0 is now catching this error case, but it seems like inference of the type parameters should be entirely possible here.The text was updated successfully, but these errors were encountered: