Closed as not planned
Description
Compiler version
main (97677cc), 3.3.0 and likely any previous version
Minimized code
def f(s: Int): Unit = println("a")
def f: Int => Unit = _ => println("b")
@main def Test =
val test: Int => Unit = f
test(0)
// f(0) // this errors out as expected
Output
Compiles, and when run prints "a".
Expectation
Should error out with an Ambiguous Overload error, like using f
directly does.
Additional comment
I found this when working on #18286, and I know that resolveOverloaded1
method here can affect which f
is being chosen - so the issue likely lies somewhere there.