WeakKeyDict(x=>x) holds on to memory

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.

Only the keys are weak references but not the values. Compare to:

julia> wk = let x = Ref{Any}(nothing)
                  WeakKeyDict(x=>1)
              end
WeakKeyDict{Base.RefValue{Any},Int64} with 0 entries