I have a question about generics. I have code like...
# announcements
r
I have a question about generics. I have code like the following:
Copy code
abstract class BaseClass<T: BaseClass<T>> {
    val children = mutableListOf<T>()
}

abstract class EntityBase<T: EntityBase<T>> : BaseClass<T>()
abstract class Entity : EntityBase<Nothing>()
abstract class EntityGroup : EntityBase<???>()  // This should have EntityBase children
What do I put in place of
???
to make
EntityGroup
have children of type
EntityBase
? No degree of nesting
EntityBase<EntityBase<EntityBase<...>>>
will work obviously, but neither does
EntityBase<*>
.