Could you please post your actual code instead of a screenshot? See PSA: how to quote code with backticks for some helpful tips on formatting code on Discourse. Screenshots make it harder to help you because there’s no way to copy your code to test it out locally.
I think all that’s going on here is that the hash for the entry in set c is different than the hash of the entry in set a, so the equality check can be performed without needing to use == at all. After all, that’s kind of the point of a hash table: most of the time we can skip equality checks when there is no hash collision.
BTW, if you want to prove this for yourself, you can use the debugger to step into the actual calls and look what’s going on. To do that, you’ll need to install Debugger.jl via:
pkg> add Debugger
and then do
using Debugger
@enter a == c
Try s to step into the next call, so to step out of a call, and o to open the given function in a text editor. The fact that Julia is mostly implemented in Julia means that you can go all the way into the guts of how Set equality works without having to switch languages or tools.
You can see how the hash comes into play in Set comparisons by purposefully defining a bad hash function that leads to collisions. Try redoing the test, for example with
If you make this change, then hash(ForbiddenPair(1,2))==hash(ForbiddenPair(2,2), so the set comparison needs to call == on the elements to figure out if they’re the same, and your extra lines will print.