Is there any way to declare the public type of a p...
# announcements
p
Is there any way to declare the public type of a property? Use case: internally I want to have a
MutableList<String>
but want the getter of the property to only expose
List<String>
. So far I've been having a backing field (i.e.:
_list
). Maybe something like?
Copy code
val list = mutableListOf<String>()
            get : List<String>