Closed
Description
The following code snippet fails to compile with Dotty. (Works with scalac)
class Test {
def println(): Unit = ()
def println(x: String): Unit = ()
def foo(x: java.util.function.Consumer[String]) = 1
foo(println(_)) // ok
foo(x => println(x)) // ok
foo(println) // error
}
-- [E007] Type Mismatch Error: tests/allan/Test.scala:26:6 ---------------------
26 | foo(println)
| ^^^^^^^
| found: Unit
| required: java.util.function.Consumer[String]
|
one error found