We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
deepcopy_internal
1 parent cf94072 commit 65f74bcCopy full SHA for 65f74bc
base/deepcopy.jl
@@ -157,7 +157,7 @@ end
157
158
function deepcopy_internal(x::AbstractLock, stackdict::IdDict)
159
if haskey(stackdict, x)
160
- return stackdict[x]
+ return stackdict[x]::typeof(x)
161
end
162
y = typeof(x)()
163
stackdict[x] = y
@@ -166,7 +166,7 @@ end
166
167
function deepcopy_internal(x::GenericCondition, stackdict::IdDict)
168
169
170
171
y = typeof(x)(deepcopy_internal(x.lock, stackdict))
172
test/copy.jl
@@ -269,4 +269,6 @@ end
269
@test a.lock !== b.lock
270
@test islocked(a.lock)
271
@test !islocked(b.lock)
272
+ @inferred deepcopy(a)
273
+ @inferred deepcopy(a.lock)
274
0 commit comments