You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the documentation (which explicitly says When a message is parsed from bytes) the default implementation for repeated fields is a Vector[T]
This is indeed true when parsing from bytes, but when constructing a new message from the Generated classes (without parsing) the underlying implementation is a List. Please see the following example:
But the _root_.scala.Seq.empty is a scala.collection.immutable.Seq which uses List as delegate by default, see also the following screenshot that compares a serialize / parsed object with the live object:
Is it possible to make the default implementation a Vector? This should also apply then to them methods like clearIds that now do copy(ids = _root_.scala.Seq.empty). But the signature should still expose Seq[T]
I know it's possible to set the collection_type option but that changes the whole signature. I want to expose the Seq as interface but the implementation should be a Vector
The text was updated successfully, but these errors were encountered:
According to the documentation (which explicitly says When a message is parsed from bytes) the default implementation for repeated fields is a
Vector[T]
This is indeed true when parsing from bytes, but when constructing a new message from the Generated classes (without parsing) the underlying implementation is a
List
. Please see the following example:Will generated code something like:
But the
_root_.scala.Seq.empty
is ascala.collection.immutable.Seq
which usesList
as delegate by default, see also the following screenshot that compares a serialize / parsed object with the live object:Is it possible to make the default implementation a Vector? This should also apply then to them methods like
clearIds
that now docopy(ids = _root_.scala.Seq.empty)
. But the signature should still exposeSeq[T]
I know it's possible to set the
collection_type
option but that changes the whole signature. I want to expose theSeq
as interface but the implementation should be aVector
The text was updated successfully, but these errors were encountered: