Regression: `replace` broken
TorkelE opened this issue · comments
MWE:
using Symbolics
@variables t X(t)
Symbolics.replace(X, X =>1)
gives a
ERROR: MethodError: no method matching operation(::Int64)
Closest candidates are:
operation(::SymbolicUtils.Code.Func)
@ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/utils.jl:224
operation(::SymbolicUtils.Code.AtIndex)
@ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/utils.jl:224
operation(::SymbolicUtils.Code.DestructuredArgs)
@ SymbolicUtils ~/.julia/packages/SymbolicUtils/qyMYa/src/utils.jl:224
...
Stacktrace:
[1] (::SymbolicUtils.Rewriters.Walk{…})(x::SymbolicUtils.BasicSymbolic{…})
@ SymbolicUtils.Rewriters ~/.julia/packages/SymbolicUtils/qyMYa/src/rewriters.jl:205
[2] #_replace#24
@ ~/.julia/packages/Symbolics/Eas9m/src/rewrite-helpers.jl:38 [inlined]
[3] _replace(expr::SymbolicUtils.BasicSymbolic{Real}, rules::Pair{Num, Int64})
@ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/rewrite-helpers.jl:32
[4] replace(::Num, ::Pair{Num, Int64})
@ Symbolics ~/.julia/packages/Symbolics/Eas9m/src/rewrite-helpers.jl:16
[5] top-level scope
@ ~/Desktop/Julia Playground/tmp/playground.jl:8
Some type information was truncated. Use `show(err)` to see complete types.
this used to work and there are tests for this, but seems to have slipped past CI