mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 15:51:01 +00:00
Before this commit, during the resolve of companion objects we used the same context than for any nested class. However, during companion object resolve we should not have companion object receiver itself accessible in any case (in particular, it should not be accessible in constructor). So in this commit we introduced separate context for this purpose.
9 lines
177 B
Kotlin
Vendored
9 lines
177 B
Kotlin
Vendored
abstract class Base(val fn: () -> String)
|
|
|
|
interface Host {
|
|
companion object : Base(run { { Host.ok() } }) {
|
|
fun ok() = "OK"
|
|
}
|
|
}
|
|
|
|
fun box() = Host.Companion.fn() |