Skip to content

Commit

Permalink
Fix maketerm when symtype is array
Browse files Browse the repository at this point in the history
  • Loading branch information
bowenszhu committed Aug 11, 2024
1 parent 77951c9 commit f0bd7e4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,18 @@ function TermInterface.maketerm(T::Type{<:BasicSymbolic}, head, args, metadata)
# Where the result would have a symtype of Bool.
# Please see discussion in https://github.com/JuliaSymbolics/SymbolicUtils.jl/pull/609
# TODO this should be optimized.
new_st = if pst === Bool
pst
elseif pst === Any || (st === Number && pst <: st)
new_st = if st <: AbstractArray
st
else
pst
end
elseif pst === Bool
pst
elseif pst === Any || (st === Number && pst <: st)
st
else
pst
end
basicsymbolic(head, args, new_st, metadata)
end


function basicsymbolic(f, args, stype, metadata)
if f isa Symbol
error("$f must not be a Symbol")
Expand Down

0 comments on commit f0bd7e4

Please sign in to comment.