xetra11
12/29/2020, 3:36 PMenum class Trait(code: String) {
AMBITIOUS("ambitious"),
HUNTER_1("hunter_1"),
WRATHFUL("wrathful"),
CALLOUS("callous"),
VIKING("viking"),
EDUCATION_MARTIAL_3("education_martial_3")
}
I want to access the code
property as described in this tutorial: https://www.baeldung.com/kotlin-enum
Having this statement
val code = Trait.EDUCATION_MARTIAL_3.code
^^^^^
Where code
Unresolved reference: code
Was the feature removed from the latest Kotlin version or what happened?Robert Jaros
12/29/2020, 3:41 PMval
is missing:
enum class Trait(val code: String) {
...
}
xetra11
12/29/2020, 3:43 PM