julia> wk = let x = Ref{Any}(nothing)
WeakKeyDict(x=>x)
end
WeakKeyDict{Base.RefValue{Any},Base.RefValue{Any}} with 1 entry:
RefValue{Any}(nothing) => RefValue{Any}(nothing)
julia> GC.gc()
julia> GC.gc()
julia> GC.gc()
julia> wk
WeakKeyDict{Base.RefValue{Any},Base.RefValue{Any}} with 1 entry:
RefValue{Any}(nothing) => RefValue{Any}(nothing)
I guess… that’s… correct? Does anyone have an explanation for this behaviour? The doc string does not help:
WeakKeyDict() constructs a hash table where the keys are weak references to objects which may be garbage collected even when referenced in a hash table.