Skip to content

Commit

Permalink
BUG: fix method shadowing for existing operators like +/-
Browse files Browse the repository at this point in the history
  • Loading branch information
jpfairbanks committed Sep 9, 2024
1 parent 18bb71f commit 4ba6dce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/symbolictheoryutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,13 @@ macro operator(head, body)
result = quote end

# construct the function on basic symbolics
argnames = [gensym(:x) for _ in 1:arity]
argclaus = [:($a::Symbolic) for a in argnames]
push!(result.args, quote
@nospecialize
function $f(args...)
s = promote_symtype($f, args...)
SymbolicUtils.Term{s}($f, [args...])
function $f($(argclaus...))
s = promote_symtype($f, $(argnames...))
SymbolicUtils.Term{s}($f, Any[$(argnames...)])
end
export $f
end)
Expand Down

0 comments on commit 4ba6dce

Please sign in to comment.