I tried that:
sealed trait AorB
trait A extends AorB { def apiA:... }
trait B extends AorB { def apiB:... }
and in another file:
trait C[AB<:AorB] extends AB
But get an error: class type required but AB found
What I actually want to do is to say that subclasses of C
should implements either A
or B
(and not AorB
which is used as some kind of trait-Enum, i.e. either A or B).
Can I do that, and how?