Files
kotlin-fork/compiler/testData/codegen/box/reflection/properties/localDelegated/defaultImpls.kt
T
pyos 6c68474489 JVM_IR: use correct signatures for local delegated property references
Which is `<v#N>` where N is the index of that property in the containing
class.
2019-03-19 12:00:29 +01:00

24 lines
413 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_REFLECT
import kotlin.reflect.KProperty
import kotlin.test.assertEquals
object Delegate {
operator fun getValue(z: Any?, p: KProperty<*>): String? {
assertEquals("val x: kotlin.String?", p.toString())
return "OK"
}
}
interface Foo {
fun bar(): String {
val x by Delegate
return x!!
}
}
object O : Foo
fun box(): String = O.bar()