<@U2SKJHSGK> These 2 functions are available since...
# language-proposals
k
@miha-x64 These 2 functions are available since KT1.1
Copy code
fun <reified T : Enum<T>> enumValues(): Array<T>

and

fun <reified T : Enum<T>> enumValueOf(name: String): T
👍 2
d
it would be cool if each Enum would have some
default
or
unknown
value, so when we pass non-existent value to
enumValueOf(...)
it would return that
unknown
instead of throwing IllegalArgumentException