`data class Data(val a: Int)` Why `Data::a` does n...
# language-proposals
r
data class Data(val a: Int)
Why
Data::a
does not return
KProperty<Data, Int>
by return
KProperty<Int>
? In first case we can write a function that receives only `Data`'s properties, something like
func process(prop: KProperty<Data, Int>)
i
Data::a
returns
KProperty1<Data, Int>
Data(1)::a
returns
KProperty0<Int>
, because it's bound to the instance
Data(1)
r
Oh, my fault, it is already working as expected
it was fixed by introducing the
KProperty1
?
this is the reason why class name is
KProperty1
?
i
KProperty1
means that it takes one receiver parameter. A bound property is
KProperty0
because it doesn't need a receiver.
👍 1