Support KCallable.call

#KT-2187 Fixed
This commit is contained in:
Alexander Udalov
2015-07-16 21:45:28 +03:00
parent ffe32e0b6d
commit e079b8f425
22 changed files with 462 additions and 3 deletions
@@ -0,0 +1,17 @@
import kotlin.reflect.*
import kotlin.reflect.jvm.*
import kotlin.test.*
class A(private var result: String)
fun box(): String {
val a = A("abc")
val p = A::class.declaredProperties.single() as KMutableProperty1<A, String>
p.accessible = true
assertEquals("abc", p.call(a))
assertEquals(Unit, p.setter.call(a, "def"))
assertEquals("def", p.getter.call(a))
return "OK"
}