I’d like to call a synthetic method of the case class
in a trait that many case classes will extend like copy
in
trait MapI[C] {
def i: Int
def s: String
def copy(i: Int = this.i, s: String = this.s): C
def mapI(i: Int): C = copy(i)
}
case class C(i: Int, s: String) extends MapI[C]
The 2.13.8 compiler stops me from doing so by "class C needs to be abstract. Missing implementation for: def copy(i: Int, s: String): C
inherited from trait MapI
" while Scala 3.1.2 works fine.
It would be great not to stop synthetic method generation in Scala 2 either if an abstract method declaration is present. This way one would not need to implemented mapI
in every case class.
Thanks for considering!