Files
kotlin-fork/compiler/testData/codegen/script/topLevelPropertyWithProvideDelegate.kts
T

22 lines
386 B
Kotlin
Vendored

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