Closed
Description
Compiler version
3.1.0
Minimized code
class Nullable[A](val value: A | Null) extends AnyVal
def f[A] = {
new (Nullable[A] => A | Null) {
def apply(nullable: Nullable[A]) = nullable.value
}
}
Output
bridge generated for member method apply(nullable: Playground.Nullable[A]): A | Null in anonymous class Object with Function1 {...}
which overrides method apply(v1: T1): R in trait Function1
clashes with definition of the member itself; both have erased type (nullable: Object): Object."
Expectation
It should compile