Files
kotlin/compiler/testData/codegen/box/enum/emptyEnumValuesValueOf.kt
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00

14 lines
263 B
Kotlin

enum class Empty
fun box(): String {
if (Empty.values().size() != 0) return "Fail: ${Empty.values()}"
try {
val found = Empty.valueOf("nonExistentEntry")
return "Fail: $found"
}
catch (e: Exception) {
return "OK"
}
}