diesieben07
08/13/2018, 9:05 PMfun <T : Any> getFieldValues(obj: T): List<Any?> {
val cls = obj::class
return cls.memberProperties.map { it.get(obj) }
}
But this does not compile, because I am getting KClass<out T>
for cls
. Is there any way to do this in a type-safe manner?udalov
val cls = obj::class as KClass<Any>
diesieben07
08/16/2018, 11:01 AM