diff --git a/src/variable.jl b/src/variable.jl index c73c423cb..8abb3b3ee 100644 --- a/src/variable.jl +++ b/src/variable.jl @@ -282,8 +282,10 @@ function Base.show(io::IO, c::CallWithMetadata) print(io, "⋆") end +struct CallWithParent end + function (f::CallWithMetadata)(args...) - metadata(unwrap(f.f(map(unwrap, args)...)), metadata(f)) + setmetadata(metadata(unwrap(f.f(map(unwrap, args)...)), metadata(f)), CallWithParent, f) end function arg_types_from_call_args(call_args)