diff --git a/base/deepcopy.jl b/base/deepcopy.jl index 7ed68bbf2b6acf..5bf1311a13603c 100644 --- a/base/deepcopy.jl +++ b/base/deepcopy.jl @@ -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)) diff --git a/test/copy.jl b/test/copy.jl index 74650d28d42d42..9b7dd82bdf03a9 100644 --- a/test/copy.jl +++ b/test/copy.jl @@ -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