ff6ea40056
Merge-request: KT-MR-8229 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
30 lines
648 B
Kotlin
Vendored
30 lines
648 B
Kotlin
Vendored
// KT-55828
|
|
// IGNORE_BACKEND_K2: NATIVE
|
|
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)
|