julia
julia copied to clipboard
incorrect hash for equal types, with Union instead of lower bound
Looks like what happened in #52997 pkgeval is during serialization of Parquet2 there were 2 distinct MethodInstance objects
getindex(WeakRefStrings.StringArray{Union{Base.Missing, 𝒯}, 1} where 𝒯, Int64)
getindex(WeakRefStrings.StringArray{𝒯, 1} where Base.Missing<:𝒯<:Any, Int64)
But during deserialization of it, these got merged into a single object.
Resulting from this bug in hash:
julia> A = Tuple{Int, Val{Union{Base.Missing, 𝒯}} where 𝒯, Int}
Tuple{Int64, Val{Union{Missing, 𝒯}} where 𝒯, Int64}
julia> B = Tuple{Int, Val{𝒯}, Int} where Missing<:𝒯<:Any
Tuple{Int64, Val{𝒯}, Int64} where 𝒯>:Missing
julia> hash(A)
0x77cfa1eef01bca90
julia> hash(B)
0x3e21480671c6d257
julia> A == B
true
Jameson says that the assertion here might have to be uncommented since this case is not so bad and actually fixing this is very hard.
Removing milestone due to https://github.com/JuliaLang/julia/pull/54408