Files
kotlin/compiler/testData/codegen/box/enum/enumEntryReferenceFromInnerClassConstructor1.kt
2018-07-23 15:08:18 +03:00

25 lines
439 B
Kotlin
Vendored

// IGNORE_BACKEND: JVM_IR
interface IFoo {
fun foo(): String
}
interface IBar {
fun bar(): String
}
abstract class Base(val x: IFoo)
enum class Test : IFoo, IBar {
FOO {
// FOO referenced from inner class constructor with uninitialized 'this'
inner class Inner : Base(FOO)
val z = Inner()
override fun foo() = "OK"
override fun bar() = z.x.foo()
}
}
fun box() = Test.FOO.bar()