Skip to content

Commit

Permalink
fix occursin
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed May 14, 2024
1 parent 0b963e7 commit d023e54
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/rewrite-helpers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,13 @@ D = Differential(t)
Symbolics.occursin(Symbolics.is_derivative, X + D(X) + D(X^2)) # returns `true`.
```
"""
function Base.occursin(r::Function, y::Union{Num, Symbolic})
_occursin(r, y)
function Base.occursin(r::Function, y::Num)
Symbolics._occursin(r, y)
end
# Initially both these were created using `y::Union{Num, Symbolic}`. However, this produced
# ambiguity error due to something in SymbolicsBase. Hence the dual declarations here.
function Base.occursin(r::Function, y::Symbolics.Symbolic)
Symbolics._occursin(r, y)
end

Base.occursin(r::Num, y::Num) = occursin(unwrap(r), unwrap(y))
Expand Down

0 comments on commit d023e54

Please sign in to comment.