Overload resolution with expected type prematurely discards matching alternative #10746
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
should compile
typer
Milestone
In the following piece of code the call to
f
at the end relies on the implicit conversionarrToIt
to convert the result of one of thearr
calls to anIt[T]
. This results in an expected type ofIt[?]
for selecting among the 3arr
methods. As can be seen from the error message the correct one is not even considered.This fails to compile with
If the single
arrtoIt
is replaced byit compiles successfully.
The situation looks similar to other overload-related bugs like #10576 but is probably not the same because in this case the correct alternative is prematurely discarded, which does not seem to play a part in the other bugs.
Tested with Scala 2.12.2 and 2.13.0-M3
The text was updated successfully, but these errors were encountered: