Код: Выделить всё
class GrammarParser {
private val grammars: List = mutableListOf()
get() = field.toList()
}
Код: Выделить всё
class GrammarParser {
private val _grammars: MutableList = mutableListOf()
val grammars: List
get() = this._grammars.toList()
}
Подробнее здесь: https://stackoverflow.com/questions/651 ... -return-mu
Мобильная версия