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.
That might seem reasonable, except that the container classes all fail to check for null elements before calling
##on them, so for exampleList(null).##also throws. By contrast ajava.util.ArrayListcontaining 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.