Files
kotlin-fork/compiler/testData/codegen/box/reflection/properties/localDelegated/inlineFun.kt
T
2019-11-19 11:00:09 +03:00

28 lines
496 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_REFLECT
import kotlin.reflect.*
import kotlin.test.assertEquals
object Delegate {
lateinit var property: KProperty<*>
operator fun getValue(instance: Any?, kProperty: KProperty<*>) {
property = kProperty
}
}
class Foo {
inline fun foo() {
val x by Delegate
x
}
}
fun box(): String {
Foo().foo()
assertEquals("val x: kotlin.Unit", Delegate.property.toString())
return "OK"
}