Hi, I have question about common reflection. If I ...
# reflect
z
Hi, I have question about common reflection. If I use jvm reflection, next code print all public properties from subtype of this superclass:
Copy code
abstract class A{
    fun printProp(){
        javaClass.kotlin.memberProperties
        .filter { it.get(this) != null }
        .forEach { println(" ${it.name}=\"${it.get(this)}\"") }
    }      
}
But I want use common kotlin. I write two examples, but it don't work as jvm example.
Copy code
abstract class A{
    fun printProp(){
        this::class.memberProperties
        .filter { it.get(this) != null }
        .forEach { println(" ${it.name}=\"${it.get(this)}\"") }
    }      
}

abstract class A{
    fun printProp(){
        A::class.memberProperties
        .filter { it.get(this) != null }
        .forEach { println(" ${it.name}=\"${it.get(this)}\"") }
    }      
}