Skip to content

Commit

Permalink
Merge pull request #872 from JuliaSymbolics/s/fix-register-esc
Browse files Browse the repository at this point in the history
don't overwrite s and s_syms in register macro
  • Loading branch information
shashi authored Mar 23, 2023
2 parents 56f988a + 67d05bb commit 561e917
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/register.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ macro register_symbolic(expr, define_promotion = true, Ts = [])
end
end

eval_method = :(@eval function $f($(Expr(:$, :(s...))),)
args = [$(Expr(:$, :(s_syms...)))]
eval_method = :(@eval function $f($(Expr(:$, :(var"##_register_macro_s"...))),)
args = [$(Expr(:$, :(var"##_register_macro_s_syms"...)))]
unwrapped_args = map($unwrap, args)
res = if !any(x->$issym(x) || $istree(x), unwrapped_args)
$f(unwrapped_args...)
Expand Down Expand Up @@ -83,8 +83,8 @@ macro register_symbolic(expr, define_promotion = true, Ts = [])
end

for sig in $Ts
s = map(((i,T,),)->Expr(:(::), Symbol("arg", i), T), enumerate(sig.parameters))
s_syms = map(x->x.args[1], s)
var"##_register_macro_s" = map(((i,T,),)->Expr(:(::), Symbol("arg", i), T), enumerate(sig.parameters))
var"##_register_macro_s_syms" = map(x->x.args[1], var"##_register_macro_s")
$eval_method
end
if $define_promotion
Expand Down

0 comments on commit 561e917

Please sign in to comment.