Rename and implement KProperty.accessible -> KCallable.isAccessible
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
import kotlin.reflect.jvm.*
|
||||
|
||||
enum class E
|
||||
|
||||
fun box(): String {
|
||||
try {
|
||||
val c = E::class.constructors.single()
|
||||
c.isAccessible = true
|
||||
c.call()
|
||||
return "Fail: constructing an enum class should not be allowed"
|
||||
}
|
||||
catch (e: Throwable) {
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ fun box(): String {
|
||||
val a = A("abc")
|
||||
|
||||
val p = A::class.declaredMemberProperties.single() as KMutableProperty1<A, String>
|
||||
p.accessible = true
|
||||
p.isAccessible = true
|
||||
assertEquals("abc", p.call(a))
|
||||
assertEquals(Unit, p.setter.call(a, "def"))
|
||||
assertEquals("def", p.getter.call(a))
|
||||
|
||||
Reference in New Issue
Block a user