voohbar
07/04/2024, 3:13 PMKProperty1<*,*>
such as MyPerson::age
. From this instance, how can I get MyPerson::class
? Introspecting the object there is a container
field that contains the value I want but there does not seem to be any API to access it officially. think smartvoohbar
07/04/2024, 3:18 PMfun KProperty<*>.declaringClass(): Class<*> {
return (this.javaField as Member? ?: this.javaGetter)?.declaringClass
?: error("Unable to access declaring class")
}
Sam
07/04/2024, 3:21 PMmyPropertyReference.instanceParameter?.type?.classifier
voohbar
07/04/2024, 3:22 PM