Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion base/deepcopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function _deepcopy_array_t(@nospecialize(x), T, stackdict::IdDict)
return dest
end

function deepcopy_internal(x::Dict, stackdict::IdDict)
function deepcopy_internal(x::Union{Dict,IdDict}, stackdict::IdDict)
if haskey(stackdict, x)
return stackdict[x]::typeof(x)
end
Expand Down
10 changes: 10 additions & 0 deletions test/copy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,14 @@ end
@test bar2.foo ∈ keys(bar2.fooDict)
@test bar2.fooDict[bar2.foo] != nothing
end

let d = IdDict(rand(2) => rand(2) for i = 1:100)
d2 = deepcopy(d)
for k in keys(d2)
@test haskey(d2, k)
end
for k in keys(d)
@test haskey(d, k)
end
end
end