Following code does not compile with Scala 2.13.6:
val a = Map(0 -> "0")
val b = Map(1 -> "1")
val c = a.view ++ b.view
c.contains(0)
The error is:
value contains is not a member of scala.collection.View[(Int, String)]
A similar error is shown in Scala 3 or Scala 2.12.15.
I find this unexpected, as implementation of concat
seem to suggest the result should be a map (mapFactory
is used to produce the result).
How can I concatenate two MapView
s to get a MapView
again?