Skip to content

Commit

Permalink
fix #30911, bug in deepcopy of UnionAll (#30930)
Browse files Browse the repository at this point in the history
(cherry picked from commit c7338ea)
  • Loading branch information
JeffBezanson authored and KristofferC committed Feb 11, 2019
1 parent 2fcf987 commit 1f87b5e
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 1f87b5e

Please sign in to comment.