Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/RuntimeGeneratedFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ function Serialization.deserialize(s::AbstractSerializer,
B === Nothing ? drop_expr(f) : f
end

# achieve deepcopy(f)===f behavior similar to "normal" julia functions
Base.deepcopy_internal(f::RuntimeGeneratedFunction, stackdict::IdDict) = f

@specialize

end
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,3 +184,8 @@ deserialized_f, deserialized_g = deserialize(buf)
@test deserialized_f.body isa Expr
@test deserialized_g(12) == "Serialization with dropped body. y=12"
@test deserialized_g.body isa Nothing

# deepcopy
ff = @RuntimeGeneratedFunction(:(x -> [x, x+1]))
@test deepcopy(ff) == ff
@test deepcopy(ff) === ff
Loading