We can say that a parameter of type T must have a certain supertype S_1:
class Test[T <: S_1]
Is there a way to say that a type parameter must have at least one supertype of several supertype alternatives? Something like (pseudo-code):
class Test[T <: S_1 || S_2]
Or: Is this impossible, because such a design does not make sense and will be a hint of a design error in the code?
source share