You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've experienced a weird bug when working on #16401. When debugging the hash(::AbstractArray, ::UInt) method, I repeatedly pasted it in the REPL and called hash(::AbstractArray). It turns out that under some circumstances, the redefinition has no effect: the old method is still used.
I've been able to reproduce the problem with relatively simple steps:
start REPL in the Julia source directory and call import Base: hash, hash_range, TypeRangeStep, RangeStepRegular, hashaa_seed, hashr_seed, hashrle_seed
copy these lines to the REPL after adding a statement like println(1) at the top of the function
call hash([1]) and check that it prints 1
run using Test; include("test/hashing.jl")
copy the lines from step 2 after increasing the value in the println call
call hash([1]) and observe that it still prints 1
If you skip step 4, the call in the last step prints 2 as expected.
The text was updated successfully, but these errors were encountered:
Yeah, when I started to have serious doubts about the fact that I wasn't just mad, but that something weird was going on, I thought it was probably worth reporting, since it's not that common to be able to reproduce this kind of thing. The fact that I identified the problem is an indication of the hard time I had getting the hashing algorithm to work (and of my lazy trial-and-error approach :-p).
I've experienced a weird bug when working on #16401. When debugging the
hash(::AbstractArray, ::UInt)
method, I repeatedly pasted it in the REPL and calledhash(::AbstractArray)
. It turns out that under some circumstances, the redefinition has no effect: the old method is still used.I've been able to reproduce the problem with relatively simple steps:
import Base: hash, hash_range, TypeRangeStep, RangeStepRegular, hashaa_seed, hashr_seed, hashrle_seed
println(1)
at the top of the functionhash([1])
and check that it prints1
using Test; include("test/hashing.jl")
println
callhash([1])
and observe that it still prints1
If you skip step 4, the call in the last step prints
2
as expected.The text was updated successfully, but these errors were encountered: