diff --git a/src/Symbolics.jl b/src/Symbolics.jl index 25a32c6e5..a9bcbaa37 100644 --- a/src/Symbolics.jl +++ b/src/Symbolics.jl @@ -30,7 +30,7 @@ import TermInterface: maketerm, iscall, operation, arguments, metadata import SymbolicUtils: BasicSymbolic, FnType, @rule, Rewriters, substitute, symtype, promote_symtype, isadd, ismul, ispow, isterm, issym, isdiv, _Sym, - _Term, get_dict, isconst + _Term, get_dict, isconst, get_val using SymbolicUtils.Code diff --git a/src/array-lib.jl b/src/array-lib.jl index 442de56ba..f0f4f1783 100644 --- a/src/array-lib.jl +++ b/src/array-lib.jl @@ -20,6 +20,13 @@ end function Base.getindex(x::SymArray, idx...) idx = unwrap.(idx) + idx = map(idx) do i + if isconst(i) + get_val(i) + else + i + end + end meta = metadata(unwrap(x)) if iscall(x) && (op = operation(x)) isa Operator args = arguments(x)