73d4fa65ea
Corresponding delegates are initialized in the host class, using '$$delegatedProperties'. TODO figure out proper code generation scheme for delegated properties in companions (KT-45580)
17 lines
250 B
Kotlin
Vendored
17 lines
250 B
Kotlin
Vendored
// WITH_RUNTIME
|
|
|
|
import kotlin.reflect.KProperty
|
|
|
|
class DP {
|
|
operator fun provideDelegate(t: Any?, kp: KProperty<*>) =
|
|
lazy { "OK" }
|
|
}
|
|
|
|
class H {
|
|
companion object {
|
|
val property: String by DP()
|
|
}
|
|
}
|
|
|
|
fun box() = H.property
|