Skip to content

Commit

Permalink
Fix bug in updating assignment handling in @batch
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Apr 2, 2021
1 parent 4cfca91 commit d44611b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/closure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ function totype!(funcs::Expr, arguments::Vector, defined::Set, expr::Expr)::Expr
args = expr.args
updateind = findfirst(Base.Fix2(===, head), (:(+=), :(-=), :(*=), :(/=)))
if updateind !== nothing
args[2] = Expr(:call, (:(+), :(-), :(*), :(/))[updateind], args[1], args[2])
args[2] = Expr(:call, (:(+), :(-), :(*), :(/))[updateind], copy(args[1]), args[2])
head = :(=)
end
t = Expr(:tuple)
ex = Expr(:curly, :Expression, QuoteNode(head), t)
if head === :call
push!(funcs.args, popfirst!(args))
elseif head === :(=)
args[1] isa Symbol && push!(defined, args[1])
elseif (head === :(=)) && args[1] isa Symbol
push!(defined, args[1])
end
for a args
push!(t.args, totype!(funcs, arguments, defined, a))
Expand Down

0 comments on commit d44611b

Please sign in to comment.