Fix IllegalAccessException on private annotation in reflection

#KT-14094 Fixed
This commit is contained in:
Alexander Udalov
2017-06-20 21:11:22 +03:00
parent fb60f4ad8f
commit 233b63469a
6 changed files with 54 additions and 1 deletions
@@ -0,0 +1,14 @@
// IGNORE_BACKEND: JS, NATIVE
// WITH_REFLECT
annotation private class Ann(val name: String)
class A {
@Ann("OK")
fun foo() {}
}
fun box(): String {
val ann = A::class.members.single { it.name == "foo" }.annotations.single() as Ann
return ann.name
}