-
Notifications
You must be signed in to change notification settings - Fork 22
null.## throws NPE #4311
Copy link
Copy link
Closed
Labels
Description
That might seem reasonable, except that the container classes all fail to check for null elements before calling ## on them, so for example List(null).## also throws. By contrast a java.util.ArrayList containing nulls hashes just fine.
Since this isn't a real method, it's easy to fix: add a null check to ScalaRunTime.hash(Any), returning zero.
Seeing this with Scala 2.8.1, but looking at the new code including Murmur hash I don't think anything's changed.
Reactions are currently unavailable