Support 'accessible' for reflected properties on JVM

Calls Java reflection's isAccessible/setAccessible
This commit is contained in:
Alexander Udalov
2014-06-05 19:15:09 +04:00
parent 1275c84f92
commit e7f19c531a
7 changed files with 150 additions and 4 deletions
@@ -0,0 +1,12 @@
import kotlin.reflect.jvm.accessible
class Result {
public val value: String = "OK"
}
fun box(): String {
val p = Result::value
p.accessible = false
// setAccessible(false) should have no effect on the accessibility of a public reflection object
return p.get(Result())
}