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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user