Consider CoreChecks.isEquivalentTo
#2443
Labels
package:checks
Issues related to pkg:checks
type-enhancement
A request for a change that isn't a bug
In Dart, an object that implements equality in respect to another object is expected to:
a == b
a.hashCode == b.hashCode
(It's possible for hashCode's to be equal, but not exact equality, for inequal objects)
To test this feature in my code, I often write a helper like:
This often catches subtle bugs where a new field is added, but only
==
is updated and nothashCode
.Would you consider this in the library itself? I also often introduce
hasToString
:... but happy to consider that separately if you're all interested.
The text was updated successfully, but these errors were encountered: