From d023e54b4a956ab360daec7467755e40abc94650 Mon Sep 17 00:00:00 2001 From: Torkel Date: Tue, 14 May 2024 14:17:11 -0400 Subject: [PATCH] fix occursin --- src/rewrite-helpers.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/rewrite-helpers.jl b/src/rewrite-helpers.jl index b2a7d0249..4ac62e11e 100644 --- a/src/rewrite-helpers.jl +++ b/src/rewrite-helpers.jl @@ -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))