Closed
Description
Compiler version
main
Minimized code
import language.experimental.captureChecking
val x = new (Int => Unit) {
def apply(x: Int): Unit = ()
}
Output
-- [E007] Type Mismatch Error: issues/cc-classes.scala:5:1 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5 |}
| ^
| Found: Object with (Int => Unit) {...}^?
| Required: (x$0: Int) ->? Unit
|
| longer explanation available when compiling with `-explain`
1 error found
Expectation
It should compile.