Help me understand the spread operator

Hey all,

Been learning Kotlin (my background is Python)!
I was pretty happy to see that Kotlin has a very similar operation to unpack a collection of items (*).

That being said, I couldn’t really find the exact reason why the spread operator only supports Arrays and not other types of collections like Lists? From my understanding, the main difference between List and and arrays is that Arrays are mutable whereas Lists are not by default (you’d have to call a mutableListOf), and arrays are fixed in size.

Where does this limitation come from?

submitted by /u/tetsukei
[link] [comments]