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

25 lines
443 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// 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()