Fix contentToString

This commit is contained in:
Him188 2020-02-28 21:38:31 +08:00
parent 58e4c156e8
commit da8a78af12
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,8 @@
package net.mamoe.mirai.utils
import kotlin.reflect.KProperty1
import kotlin.reflect.jvm.javaField
internal actual fun KProperty1<*, *>.getValueAgainstPermission(receiver: Any): Any? {
return this.javaField?.apply { isAccessible = true }?.get(receiver)
}

View File

@ -0,0 +1,8 @@
package net.mamoe.mirai.utils
import kotlin.reflect.KProperty1
import kotlin.reflect.jvm.javaField
internal actual fun KProperty1<*, *>.getValueAgainstPermission(receiver: Any): Any? {
return this.javaField?.apply { isAccessible = true }?.get(receiver)
}