On a val
, you can skip the data type declaration on the property, replacing
it with your custom getter function. This requires that getter function to clearly
indicate its return type, as Kotlin has no other way of inferring that type.
You can learn more about this in:
Tags: