Closed
Description
struct totally_not_five end
Base.isequal(::totally_not_five, x)=isequal(5,x);
Base.isequal(x, ::totally_not_five)=isequal(5,x);
Base.isequal(::totally_not_five, ::totally_not_five)=true;
Base.hash(::totally_not_five, h::UInt64)=hash(5, h);
import Base.==
==(::totally_not_five, x)= (5==x);
==(x,::totally_not_five)= (5==x);
==(::totally_not_five,::totally_not_five)=true;
n5=totally_not_five();
############
versioninfo()
#Julia Version 0.7.0-DEV.3961
#Commit 12964e839e* (2018-02-13 10:42 UTC)
5== n5 #true
isequal([4,n5,6], [4,5,6]) #true
isequal(hash([4,n5,6]), hash([4,5,6])) # false
isequal(hash([n5,4,n5,6]), hash([n5,4,5,6])) #true
############
versioninfo()
#Julia Version 0.6.2
#Commit d386e40 (2017-12-13 18:08 UTC)
5== n5 #true
isequal([4,n5,6], [4,5,6]) #true
isequal(hash([4,n5,6]), hash([4,5,6])) # true
isequal(hash([n5,4,n5,6]), hash([n5,4,5,6])) #true
I fear that this is fundamental to the current approach for O(1) range hashing (but I would be happy to be corrected!).