-
Notifications
You must be signed in to change notification settings - Fork 21
Type inference not working with java overloads #12139
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
Comments
This is a known limitation and there are similar tickets which ticket fatigue prevents me from discovering. Worth noting that if the overloads share the parameter of interest, inference is improved:
then
The spec stipulates that arguments are typechecked without an expected type, but does not preclude adaptations after an overload is selected. |
I'm not surprised to hear this is a known limitation. Feel free to close this if it's covered elsewhere. |
We can reopen if someone can substantiate that this one is actually different. |
Seth is immune to ticket fatigue. Scala Center ought to present the Seth Tissue Award in Issuology in recognition of exceptional cross-ticketing. |
Forgive me if this is a duplicate, but there are cases where the scala compiler will infer
Nothing
where it is unexpected. This came up in playframework/playframework#10442. I was able to reproduce with 2.10.7, 2.11.11, 2.12.12 and 2.13.3.reproduction steps
create a java file Foo.java:
create a scala file Bar.scala:
compile the project
problem
If I remove the overloaded
foo
method that takes aFoo
, it does compile.The text was updated successfully, but these errors were encountered: