Skip to content

Commit

Permalink
Only expand @. macros
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Jul 28, 2017
1 parent 79b93ea commit 8b05ba9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ end

function to_muladd(ex::Expr)
if !isaddition(ex)
if ex.head == :macrocall
# expand macros first (enables use of @. inside of @muladd expression)
return to_muladd(macroexpand(ex))
if ex.head == :macrocall && length(ex.args)==2 && ex.args[1] == Symbol("@__dot__")
# expand @. macros first (enables use of @. inside of @muladd expression)
return to_muladd(Base.Broadcast.__dot__(ex.args[2]))
else
# if expression is no sum apply the reduction to its arguments
return Expr(ex.head, to_muladd.(ex.args)...)
Expand Down

0 comments on commit 8b05ba9

Please sign in to comment.