Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/selfReferenceToCompanionObject.kt
T
Mikhail Glukhikh 9a5791ad6d FIR: use correct context for enum entry resolve
Now the same resolve context is used for enum entries and
for constructors.
2021-01-18 08:34:46 +03:00

21 lines
462 B
Kotlin
Vendored

abstract class Base(val fn: () -> String)
class Host {
companion object : Base(run { { Host.ok() } }) {
fun ok() = "OK"
}
}
enum class Test(val x: String, val closure1: () -> String) {
FOO("O", run { { FOO.x } }) {
override val y: String = "K"
val closure2 = { y } // Implicit 'FOO'
override val z: String = closure2()
};
abstract val y: String
abstract val z: String
}
fun box() = Host.Companion.fn()