Is it possible in Scala to enforce the implementation of a typed trait for subclasses with the type of the subclass? Ie. I'd like to define a trait which forces all subtypes to implement Ordered for only the concrete subtype. So I want to ensure that every implementation TraitImpl of the trait ATrait implements Ordered[TraitImpl]. Below is a non working example to illustrate what I am trying to do.
trait ATrait extends Ordered[_ <: ATrait] { } class TraitImpl extends ATrait { override def compare(that: TraitImpl): Int = ??? }