@al3c thanks for the quick answer! Yes, I know that it should be NAME, however this is from a generated code (a client generated from a graphql schema) and it uses the names found in the schema.
Can you point me to where is this defined that “name” cannot be an enum member?
That is both true and false. The name property is inspired from Java, but it’s not about inheritance. You also can’t use name in Kotlin/JS, where nothing inherits from Java.
kotlin.Enum<T> is the built-in parameterized classifier type which is used as a superclass for all enum classes: every enum class E is implicitly a subtype of kotlin.Enum<E> .
On JVM they happen to be the same:
fun main() {
println(java.lang.Enum::class == kotlin.Enum::class)
}