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
?
👍 1
u
Also, what about adding
fun <T : Enum<T>> valuesOf(klass: KClass<T>): Array<T> = klass.java.enumConstants
?
https://youtrack.jetbrains.com/issue/KT-14743
m
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.
b
This probably belongs in the #stdlib channel, too