I have a class like
class Foo {
val bar = Bar()
fun doSomething() {
}
}
How do I get the fields or properties of the class Foo in doSomething?
Looking into this::class only has little available:

I added the reflect dependency but it does not appear to have done anything:
val nativeMain by getting {
dependencies {
implementation(kotlin("reflect"))
}
}
The class I'm writing is going to have a lot of properties which are all handled the same way so I'd like to iterate over them so that I don't have to manually write everything myself in a hard-coded fashion.
you can use this code instead of
this::class.In your example
for more reference Reflection