I need a (mutable)
Seq that is only
Growable. I do not need to update any index or shrink the collection or
transform it (or any other form of mutation), Just grow it (
+=) and I want to actively protect the collection from other mutations.
- The problem with
Buffers is that they are not just
Growable but also
Shrinkable and can be
Seq is not
Shrinkable but it can transform and it is not
To my (cursory) understanding of scala collection, there is no concrete implementation that has the exact traits that I'm looking for so I believe I have to implement my own?
val hands : collection.Seq[Team] with Growable[Team] = mutable.Seq[Team]()
in an attempt to make the nominal type conform to my requirements, actively preventing the client to call the undesired mutating methods on
hands but it says types does not conform.