Fix reflection for local delegated properties inside interface
#KT-19690
This commit is contained in:
committed by
Mikhael Bogdanov
parent
97d46e76f5
commit
4d2fbf1801
+23
@@ -0,0 +1,23 @@
|
||||
// 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()
|
||||
Reference in New Issue
Block a user