gildor
04/03/2018, 5:29 AMbut it can still mess up the content rightYes, if object in list is mutable there is no protection from modification. The only way: make object immutable or copy it before return:
val myMutableList = mutableListOf<Foo>()
val list: List<Foo>
get() = myMutableList.map { it.copy() } // Copy each item of Foo before return