In the official document, I found enumValues() function.
I used enumValues() function, but I cannot find difference.
enum class RGB {
RED, GREEN, BLUE
}
RGB.values().joinToString { it.name } // RED, GREEN, BLUE
enumValues<RGB>().joinToString { it.name } // RED, GREEN, BLUE
What difference between enumValues() and Enum.values()?
Is it a function for platforms other than JVM? Or are there other use cases?
enumValues<T>()andenumValueOf<T>()functions.EnumClass.values()is still used and has the same operational meaning, read above theenumValues().