What I mean by structural mutation (I think it’s the correct technical term but I can’t find much on this topic) is for example if a lists mutates its internal representation to make place for a new entry or optimize for speed and so on.
An Array haves a fixed size, so could I assume that Kotlins in array never mutate their structure (meaning if I add, delete an entry, only that entry is touched). Is Kotlin guaranteeing this?
Also for mutable collections like lists and maps, is somewhere documented which functions mutate the structure of the collection itself and not only the entry (like I expect add to mutate the structure)?
Or is this never exposed meaning that even if the get function (mylist) doesn’t mutate the structure of the List today, it still may mutate it in future versions?
So I’m interested in the special case of arrays and also in mutable collections in general because the answer could possibly differ.