-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
First reported in scala/scala3#4936; both sealed
and final
are redundant on object
, but final object
seems pretty common (though it's redundant).
scala> trait A { object A }
defined trait A
scala> trait B extends A { object A }
<console>:12: error: overriding object A in trait A;
object A cannot override final member
trait B extends A { object A }
^
OTOH, final object
seems pretty common, and it even appears in the new collections, maybe because it is sometimes used in such pattern (from Dotty) — and final
on case classes does make sense.
sealed trait Status
final case class Success(output: String) extends Status
final case class Failure(output: String) extends Status
final case object Timeout extends Status
We're considering changing this in Dotty in scala/scala3#4973, but it'd be good to do the change in 2.14 as well I guess — or (EDIT) at least agree that we want to do it.
NthPortal, ShaneDelmore, BalmungSan, timothyklim, jhnsmth and 2 more
Metadata
Metadata
Assignees
Labels
No labels