Skip to content

Commit

Permalink
feat: add CallWithParent to keep track of callable variables
Browse files Browse the repository at this point in the history
  • Loading branch information
AayushSabharwal committed Sep 13, 2024
1 parent e1ba803 commit 1fb4338
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/variable.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1fb4338

Please sign in to comment.