-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Another strange behavior with type inference #1947
Comments
The issue here is that neither You could argue we should try harder to find a suitable type argument for the first overload, but we have to balance that against trying too hard and making a bad inference instead of giving an error. This one is right one the edge, but I'm not sure what we could change to do better. |
No in this example the overload with |
I'll say it here too, why not add a new syntax to say which one is used for type inference:
This little |
This needs a more thorough explanation of the proposed fix before we can look at it. |
This call succeeds now 🤷♂️ |
I'm sorry to bother you again but this one seems pretty much strange:
myFunc
is perfectly valid with the first overload and not with the second one, but the compiler still pick the second.myFunc(A, { prop: ''})
the fact that the compiler pick the second overload make the error hard to understand for the developer.The text was updated successfully, but these errors were encountered: