Why doesn’t `kotlin.Enum.Companion` contain a mapp...
# language-proposals
m
Why doesn’t
kotlin.Enum.Companion
contain a mapping to
java.lang.Enum.valueOf()
? Also, what about adding
fun <T : Enum<T>> valuesOf(klass: KClass<T>): Array<T> = klass.java.enumConstants
? 2 replies Also, Kotlin has a chance to fix Java’s problem and return the same cached unmodifiable list of values on each invocation instead of proxying to Java’s function which clones an array.