scala3
scala3 copied to clipboard
Incorrect error message during eta-expansion
Compiler version
scalaVersion = 3.2.1-RC1 / 3.2.0
Minimized code & Output
def foo(x: Int)(y: String): Int = x
val voo: (Int, String) => Int = foo // error:
// Found: String => Int
// Required: Int
https://scastie.scala-lang.org/LvKVtDGbSJ2SKl4dpHH92w
Which seems to suggest def foo(x: Int): Int would have the correct signature, which is wrong
Expectation
A similar error to what is done with a function on the RHS:
def foo(x: Int)(y: String): Int = x
val voo: (Int, String) => Int = (foo: Int => String => Int) // error:
// Found: Int => String => Int
// Required: (Int, String) => Int
https://scastie.scala-lang.org/9WE77Zj1Temgx92F4l5gKA