I have a
class Foo {
lateinit var property1: String
lateinit var property2: Int
lateinit var property3: Long
}
Then is it possible to pass a property of the class in a function like this one?
fun bar(fooProperty: FooProperty) {
println(
when(fooProperty) {
Foo.property1 -> "Property1"
Foo.property2 -> "Property2"
Foo.property3 -> "Property3"
}
)
}
This is invalid code however. I was just wondering if that is achievable.