Skip to content

Commit 2579558

Browse files
fix: don't toparam inside Initial
1 parent 441ab02 commit 2579558

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/systems/abstractsystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,14 +668,14 @@ function (f::Initial)(x)
668668
iscall(x) && operation(x) isa Initial && return x
669669
result = if symbolic_type(x) == ArraySymbolic()
670670
# create an array for `Initial(array)`
671-
Symbolics.array_term(f, toparam(x))
671+
Symbolics.array_term(f, x)
672672
elseif iscall(x) && operation(x) == getindex
673673
# instead of `Initial(x[1])` create `Initial(x)[1]`
674674
# which allows parameter indexing to handle this case automatically.
675675
arr = arguments(x)[1]
676-
term(getindex, f(toparam(arr)), arguments(x)[2:end]...)
676+
term(getindex, f(arr), arguments(x)[2:end]...)
677677
else
678-
term(f, toparam(x))
678+
term(f, x)
679679
end
680680
# the result should be a parameter
681681
result = toparam(result)

0 commit comments

Comments
 (0)