Closed
Description
openedon Dec 22, 2017
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 prints1
- 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 prints1
If you skip step 4, the call in the last step prints 2
as expected.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment