Open
Description
Minimized example
class A {
case class B()
}
Output
If we compile with -Xprint:typer we get this line in the definitions of B
:
override def hashCode(): Int = scala.runtime.ScalaRunTime._hashCode(this)
The hashcode does not account for the hashcode of the outer object, even though equals does compare outer objects. This leads to bad hash functions if inner case classes are used as keys in maps.