It is late and my brain may be malfunctioning, but can someone explain why
this code returns 2 instead of 1? It appears the Hash object is ignoring my
hash method's return value. When I put a print inside the hash method it
showed it was being called.
class A
def hash
return 1
end
def == other
return hash.eq?(other.hash)
end
end
h = {A.new => nil, A.new => nil}
puts h.size # --> 2