Files
kotlin-fork/compiler/testData/codegen/box/enum/kt44744_innerClass.kt
T
Nikolay Lunyak bcfafc601e Add EnumEntries to minimal-stdlib-for-tests
This change allows to revert adding `WITH_STDLIB` directive
to tests which happened at `a9343aeb`.

Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>
2023-03-02 10:23:38 +00:00

28 lines
607 B
Kotlin
Vendored

interface IFoo {
fun foo(e: En): String
}
enum class En {
TEST {
inner class Nested : IFoo {
private val ee = TEST
override fun foo(e: En): String {
return if (e == ee) e.ok else "Failed"
}
}
override val ok: String get() = "OK"
override fun foo(): IFoo = Nested()
},
OTHER {
override val ok: String get() = throw AssertionError()
override fun foo(): IFoo = throw AssertionError()
};
abstract val ok: String
abstract fun foo(): IFoo
}
fun box() = En.TEST.foo().foo(En.TEST)