Skip to content
Merged
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
16 changes: 8 additions & 8 deletions src/foundation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -628,23 +628,23 @@ macro autoreleasepool(ex...)
# function definition, short form
sig, body = code.args
@assert Meta.isexpr(body, :block)
managed_body = quote
$f() do
managed_body = Expr(:block, __source__,
:($f() do
$body
end
end
end)
)
esc(Expr(:(=), sig, managed_body))
elseif Meta.isexpr(code, :function)
# function definition, long form
sig = code.args[1]
@assert Meta.isexpr(sig, :call) || Meta.isexpr(sig, :where)
body = code.args[2]
@assert Meta.isexpr(body, :block)
managed_body = quote
$f() do
managed_body = Expr(:block, __source__,
:($f() do
$body
end
end
end)
)
esc(Expr(:function, sig, managed_body))
else
# code block
Expand Down