Skip to content

Commit

Permalink
add warning to hash(::AbsMPolyMultSet)
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed May 22, 2023
1 parent a7d55ef commit 0dfcbe8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Rings/mpoly-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -533,9 +533,11 @@ function ==(T::AbsMPolyMultSet, U::AbsMPolyMultSet)
return (issubset(T, U) && issubset(U, T))
end

function Base.hash(T::AbsMPolyMultSet, h::UInt)
function Base.hash(T::AbsMPolyMultSet{BRT, BRET, RT, RET}, h::UInt) where {BRT,BRET,RT,RET}
@warn """Hashing of multiplicative sets of type AbsMPolyMultSet is badly implemented
and should not be used. Please provide a better implementation for the type $(typeof(T))."""
b = 0x7ce51a28c47ec5e1 % UInt
h = hash(typeof(T), h)
h = hash((BRT, BRET, RT, RET), h)
h = hash(ambient_ring(T), h)
return xor(h, b)
end
Expand Down

0 comments on commit 0dfcbe8

Please sign in to comment.