What is the underlying List type for Kotlins read ...
# getting-started
v
What is the underlying List type for Kotlins read only list?
s
what do you mean specifically by “Kotlin’s read-only list”
v
in the AbstractList docs: provides a skeletal implementation of the read-only List interface.
c
Abstract list is exactly that: abstract. It doesn’t have an implementation. Many of the Collections APIs return an ArrayList on JVM (which is technically mutable, but only the read-only portion of its interface is exposed), or else some more optimized implementation for empty/singleton lists or platform-specific variants. But knowing it’s an ArrayList is just an implementation detail, and should not be relied upon
👍 1
👆 2
t
fun idea: gradle plugin that randomly changes the underlying implementations of the collections, to try and root out all those "should not be relied upon" but still do places.
😂 4