Skip to content

Commit

Permalink
fix JuliaLang#30911, bug in deepcopy of UnionAll (JuliaLang#30930)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Feb 1, 2019
1 parent b5bc6b7 commit c7338ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/deepcopy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ updated as appropriate before returning.
"""
deepcopy(x) = deepcopy_internal(x, IdDict())::typeof(x)

deepcopy_internal(x::Union{Symbol,Core.MethodInstance,Method,GlobalRef,DataType,Union,Task},
deepcopy_internal(x::Union{Symbol,Core.MethodInstance,Method,GlobalRef,DataType,Union,UnionAll,Task},
stackdict::IdDict) = x
deepcopy_internal(x::Tuple, stackdict::IdDict) =
ntuple(i->deepcopy_internal(x[i], stackdict), length(x))
Expand Down
3 changes: 3 additions & 0 deletions test/copy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ end
@test c[1] === c[2]
end

# issue #30911
@test deepcopy(Array{Int,N} where N) == Array{Int,N} where N

# issue #14027
struct Nullable14027{T}
hasvalue::Bool
Expand Down

0 comments on commit c7338ea

Please sign in to comment.