I’m looking at the “Calling Java from Kotlin” docs...
# getting-started
d
I’m looking at the “Calling Java from Kotlin” docs and the sections on operators and it leaves me wondering, if I have a Java record type and place
componentN
methods on that record, will Kotlin be able to use it for destructuring?
1
p
Yes, it should, but also: don’t Records are explicitly named tuples, and positional destructuring throws away those semantics.
with(someRecordInstance)
or
someRecordInstance.run {}
or
.apply
or whatever will bring in the record components as their names
1
d
Thank you