which does the is check on whole collection and buala:
Copy code
data class Example(
val one: Int,
var two: String,
val three: String,
var four: Int,
)
val mutableProperties: List<KMutableProperty1<*, *>> =
Example::class.memberProperties.filterIsInstance<KMutableProperty1<*, *>>()
mutableProperties.map { it.name to it.returnType }
// == [(four, <http://kotlin.Int|kotlin.Int>), (two, kotlin.String)]
Roukanken
12/13/2021, 8:12 PM
(the type of the variable is not needed, only there to be clear what it is)