bug
bug copied to clipboard
case class synthetic method generation when abstract method declaration is present
Reproduction steps
Scala version: 2.13.8
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]
Problem
The compiler reports "class C needs to be abstract. Missing implementation for: def copy(i: Int, s: String): C inherited from trait MapI".
Expectation
I'd appreciate the compiler not stopping synthetic method generation if an abstract method declaration is present. This way one would not need to implement mapI in every case class. I also checked Scala 3.1.2 which works fine.
See also
https://contributors.scala-lang.org/t/continue-with-case-class-synthetic-method-generation-when-abstract-method-declaration-is-present/5826
A "has PR" label is strictly redundant with Github's tag "May be fixed by".