case objects
final
SC-W1067Any entity marked as case
in Scala has certain implementations such as toString
automatically filled. To avoid un-intended side-effects such as inheritance and to address the inconsistent behavior of entities not being tagged as final
(between different Scala versions), it is recommended that you make case objects
final
.
class C {
case object inner
}
class C {
final case object inner
}