Given this enum class: ``` enum class Trait(cod...
# getting-started
x
Given this enum class:
Copy code
enum 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
Copy code
val code = Trait.EDUCATION_MARTIAL_3.code
                                    ^^^^^
Where
code
Unresolved reference: code
Was the feature removed from the latest Kotlin version or what happened?
r
val
is missing:
Copy code
enum class Trait(val code: String) {
...
}
🙌 1
x
...I ... I knew that
😛