Skip to main content
7 events
when toggle format what by license comment
Aug 19, 2023 at 11:06 comment added gnasher729 The rule (language independent) is: Equal implies hashes are equal, but equal hashes does not imply equal. Although with a good hash it is very unlikely they are not equal.
Aug 19, 2023 at 9:08 vote accept Fabrizio
Aug 19, 2023 at 9:07 comment added Fabrizio You are correct. In dart hashCode and equals do not have to be equal, what I was referring to is more of a suggestion than a rule (dart.dev/tools/linter-rules/hash_and_equals).
Aug 19, 2023 at 8:13 answer added Doc Brown timeline score: 3
Aug 18, 2023 at 23:06 comment added Alexei Levenkov Side note: I have no idea about dart, but in all other languages the statement "if I implement such an hashCode, I would have to reduce the equals operator to comparing the Ids" look invented from thin air. Could you please edit the post to clarify why dart imposes such a strange restriction? (usually one can even return 42 as hash code and still can have meaningful comparison operation for hash-based collections)
S Aug 18, 2023 at 19:58 review First questions
Aug 19, 2023 at 9:18
S Aug 18, 2023 at 19:58 history asked Fabrizio CC BY-SA 4.0