Files
kotlin/compiler/testData/codegen/box/enum/whenInObject.kt
2019-11-19 11:00:09 +03:00

17 lines
245 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
enum class E {
OK, NOT_OK
}
interface I {
fun f(e: E): String
}
val obj = object: I {
override fun f(e: E) = when(e) {
E.OK -> "OK"
E.NOT_OK -> "NOT OK"
}
}
fun box() = obj.f(E.OK)