Details
-
Type:
Bug
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: Scala 2.8.0, Scala 2.8.1, Scala 2.9.0, Scala 2.9.1, Scala 2.11.1
-
Fix Version/s: Scala 2.13.0-RC1
-
Component/s: None
-
Labels:None
-
Environment:
n/a
Description
In revision 21018, filterKeys and mapValues started returning map views in everything but name. This cause a few problems, however – the lack of a distinct type does not help identifying them as returning non-strict collections, and they lack a force method to retrieve a strict collection.
I'd suggest returning a MapView, but there isn't any such collection at the moment – view returns an IterableView instead. Perhaps the ideal would be to create a MapView, and make filterKeys and mapValues only non-strict in them.
Bumped into this in 2.9.2 and thought, "I'll just throw .seq onto the result". It doesn't work. Basically .mapView and .filterKeys are still lazy with no way to force. It's true `Map` extends GenMap and so I have only myself to blame but it was a bit of a nasty surprise.