Files
kotlin-fork/compiler/testData/codegen/box/enum/whenInObject.kt
T
Mikhail Glukhikh a4c7619c89 [FIR2IR] Introduce & use FirBuiltInsPackageFragment
Without this commit, JVM name mapping logic in BE does not work for FIR,
because FIR cannot use old BuiltInsPackageFragmentImpl descriptor.
In this commit we add our own implementation thus fixing
a pack of FIR black box tests.
2020-03-24 10:37:53 +03:00

16 lines
215 B
Kotlin
Vendored

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)