Skip to content

Commit 0b500c1

Browse files
vyuduAayushSabharwal
authored andcommitted
fix: fix discrete variable detection in IndexCache
1 parent 0a31c91 commit 0b500c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/systems/index_cache.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ function IndexCache(sys::AbstractSystem)
117117
affs = [affs]
118118
end
119119
for affect in affs
120-
if affect isa Equation
121-
is_parameter(sys, affect.lhs) && push!(discs, affect.lhs)
122-
elseif affect isa FunctionalAffect || affect isa ImperativeAffect
120+
if affect isa AffectSystem || affect isa FunctionalAffect ||
121+
affect isa ImperativeAffect
123122
union!(discs, unwrap.(discretes(affect)))
123+
elseif isnothing(affect)
124+
continue
124125
else
125126
error("Unhandled affect type $(typeof(affect))")
126127
end

0 commit comments

Comments
 (0)