From 7145fc92884b2c55aee9b834d2c7f8e006168aed Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Fri, 1 Feb 2019 16:43:23 -0500 Subject: [PATCH] fix #30911, bug in `deepcopy` of `UnionAll` (#30930) (cherry picked from commit c7338ea61a3948214014c950c7f895efc8a66e73) --- base/deepcopy.jl | 2 +- test/copy.jl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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