vaskir: yes anything more than Pair/Tuple, you should use data class.
v
vaskir
05/12/2017, 3:43 PM
Should? Why? Kotlin does not have anonymous classes / records, so forcing developers to define a data class every time he wants to return multiple values looks a bit strange.
s
suresh
05/12/2017, 4:04 PM
I would say it’s a code smell if you want to return more than 2/3 entries from a function and qualifies them to use in data class. I agree, there is no generic way and you might end up creating different data classes.