Missing hashCode definitions
Closed this issue · 2 comments
The Scalastyle linter complains about missing hashCode
definitions in Silicon. I'm not sure if we did that intentionally but it seems worth double-checking, adding a comment to Silicon if there is nothing to fix.
Defining either
equals()
orhashCode()
in a class without defining the other is a known source of bugs. Usually, when you define one, you should also define the other.Further Reading: Scalastyle - EqualsHashCode
silicon/annotation/Terms.example.scala
Lines 849 to 878 in fd51ab6
silicon/src/main/scala/state/Chunks.scala
Lines 150 to 157 in fd51ab6
I'm confused. Don't the first two have both explicit equals and hashCode definitions? The other two look potentially problematic, I agree.
I'm confused. Don't the first two have both explicit equals and hashCode definitions?
Yes, sorry. I just copy-pasted the warnings, but I guess that the linter didn't see the val
methods.