Title
s

stoyicker

02/18/2017, 6:19 PM
why isn’t the return type
ImmutableList
?
m

miha-x64

02/18/2017, 6:31 PM
stoyicker: because there's no such interface in Kotlin.
if (list !is MutableList) {
, it is, probably, immutable.
}
s

stoyicker

02/18/2017, 6:32 PM
what does “probably” mean?
v

voddan

02/18/2017, 6:37 PM
It means that implementation may be mutable, while the interface is read only
for example,
listOf
sometimes returns an immutable list, sometimes it returns an
ArrayList
, which is mutable, but still complies to read-only
List