Files
kotlin-fork/compiler/testData/codegen/box/delegatedProperty/provideDelegate/kt18902.kt
T
2019-11-19 11:00:09 +03:00

23 lines
490 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
import kotlin.properties.ReadOnlyProperty
import kotlin.reflect.KProperty
class Delegate: ReadOnlyProperty<Test, String> {
override fun getValue(thisRef: Test, property: KProperty<*>) = "OK"
}
class Provider {
operator fun provideDelegate(thisRef: Test, property: KProperty<*>) = Delegate()
}
class Test {
companion object {
val instance = Test()
}
val message by Provider()
}
fun box() = Test.instance.message