I was just migrating to scala 2.13 and realised, that the only collections related migration I had to do, was with JsObject. I was using this two fields
/**
* The fields of this JsObject in the order passed to the constructor
*/
lazy val fields: collection.Seq[(String, JsValue)] = underlying.toSeq
/**
* The value of this JsObject as an immutable map.
*/
lazy val value: Map[String, JsValue] = underlying match {
case m: immutable.Map[String, JsValue] => m
case m => m.toMap
}
What I found interesting is, that even the second comment says immutable map and underlying.toSeq is returning an immutable.Seq the return values are collection.Mapand collection.Seq. This seems odd to me. Especially because immutable collections should be considered the default, since it is what is defined in predef now (2.13).
Are there any good reasons to not change this to immutable?
I was just migrating to scala 2.13 and realised, that the only collections related migration I had to do, was with JsObject. I was using this two fields
What I found interesting is, that even the second comment says
immutable mapandunderlying.toSeqis returning animmutable.Seqthe return values arecollection.Mapandcollection.Seq. This seems odd to me. Especially because immutable collections should be considered the default, since it is what is defined in predef now (2.13).Are there any good reasons to not change this to immutable?