Closed
Description
Mutating copy on abstract sets is implemented as union!(empty!(dst), src)
:
Line 6 in 6dfa690
This fails when copying a Set
to itself — arguments are evaluated from left to right and the set is emptied and returned.
julia> s = Set([1, 2, 3])
Set{Int64} with 3 elements:
2
3
1
julia> copy!(s, s)
Set{Int64}()
The same behavior exists for Dict
s:
Line 158 in 61ae86d
julia> d = Dict(1 => 2, 3 => 4)
Dict{Int64, Int64} with 2 entries:
3 => 4
1 => 2
julia> copy!(d, d)
Dict{Int64, Int64}()
Metadata
Metadata
Assignees
Labels
No labels