Provide sensible toString for getter/setter in reflection.

This commit is contained in:
scaventz
2021-03-11 01:23:18 +08:00
committed by Alexander Udalov
parent 8b3ff11a2b
commit 0dc5ed53f8
2 changed files with 10 additions and 0 deletions
@@ -155,6 +155,8 @@ internal abstract class KPropertyImpl<out V> private constructor(
override val caller: Caller<*> by ReflectProperties.lazy {
computeCallerForAccessor(isGetter = true)
}
override fun toString(): String = "getter of $property"
}
abstract class Setter<V> : Accessor<V, Unit>(), KMutableProperty.Setter<V> {
@@ -168,6 +170,8 @@ internal abstract class KPropertyImpl<out V> private constructor(
override val caller: Caller<*> by ReflectProperties.lazy {
computeCallerForAccessor(isGetter = false)
}
override fun toString(): String = "setter of $property"
}
companion object {