Files
kotlin-fork/compiler/testData/codegen/script/topLevelPropertyWithProvideDelegate.kts
T
2023-12-26 10:18:19 +00:00

23 lines
438 B
Kotlin
Vendored

// JVM_ABI_K1_K2_DIFF: KT-63960, KT-63963, KT-63964
import kotlin.reflect.KProperty
class Delegate {
operator 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()
}
val x = Test.instance.message
// expected: x: OK