为什么要覆盖hashCode
二进制不兼容的更改:
前:
trait Foo extends Product
后:
trait Foo extends Product {
private[this] lazy val _hashCode = ScalaRunTime._hashCode(this)
override def hashCode: Int = _hashCode
}
迁移经理 说:
[error] * synthetic method Foo$$_hashCode()Int in trait Foo is present only in current version
[error] filter with: ProblemFilters.exclude[ReversedMissingMethodProblem]("Foo.Foo$$_hashCode")
这真的是个问题吗?或者我可以通过此更改保持相同的次要版本吗?