Why is overriding hashCode
a binary incompatible change:
Before:
trait Foo extends Product
After:
trait Foo extends Product {
private[this] lazy val _hashCode = ScalaRunTime._hashCode(this)
override def hashCode: Int = _hashCode
}
Migration-Manager says:
[error] * synthetic method Foo$$_hashCode()Int in trait Foo is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("Foo.Foo$$_hashCode")
Is this actually a problem? Or can I stay on the same minor version with this change?
Not a direct answer, but it's possibly to avoid the
private[this] lazy val
altogether:Here, MiMa does not complain.