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 3c2894d commit 2b6f488Copy full SHA for 2b6f488
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
@@ -267,4 +267,6 @@ end
267
@test a.lock !== b.lock
268
@test islocked(a.lock)
269
@test !islocked(b.lock)
270
+ @inferred deepcopy(a)
271
+ @inferred deepcopy(a.lock)
272
0 commit comments