I am working with a sealed
class hierarchy that has some type bounds:
sealed class CmECSOp<Component, Type> where Component : Typed<Type>, Component : TimeStamped {
data class Create<Component, Type>(val id: UUID) : CmECSOp<Component, Type>() where Component : Typed<Type>, Component : TimeStamped
data class Destroy<Component, Type>(val id: UUID) : CmECSOp<Component, Type>()where Component : Typed<Type>, Component : TimeStamped
data class Set<Component, Type>(val id: UUID, val component: Component): CmECSOp<Component, Type>() where Component : Typed<Type>, Component : TimeStamped
data class UnSet<Component, Type>(val id: UUID, val component: Component): CmECSOp<Component, Type>() where Component : Typed<Type>, Component : TimeStamped
}
However, this is pretty verbose because of all the bounds repetition. Is there a way to make this shorter or am I doing something wrong?