Kotlin - categorized subenums
I am trying to implement a Role class/interface/enum that I can use throughout my program. I want the roles to be somewhat categorized - I want some roles to be of type A, some roles to be of type B, and some roles to be part of multiple types. I want to be able to know all the roles from each type - so an enum/sealed class structure is the idea.
I tried the following implementation -
sealed interface UserRole {
val roleName: String
}
enum class RoleA(override val roleName: String):...