Closed
Description
minimized code
trait TC[A] {
def apply(a: A): Unit
}
class Foo[A](val value: A) extends AnyVal
object Foo {
val tc = new TC[Foo[String]] {
def apply(a: Foo[String]): Unit = ()
}
}
Compilation output
-- Error: TC.scala:8:8 ---------------------------------------------------------
8 | def apply(a: Foo[String]): Unit = ()
| ^
|bridge generated for member method apply(a: Foo[String]): Unit in anonymous class Object with TC {...}
|which overrides method apply(a: A): Unit in trait TC
|clashes with definition of the member itself; both have erased type (a: Object): Unit."
1 error found
expectation
Another minimization from the Cats tests. Scala 2 is fine with this.