Skip to content

Commit 0a241fc

Browse files
committed
fix batching error
check the condition function of equality not just type equality
1 parent d012841 commit 0a241fc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/callbacks.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,9 @@ function _batchequal(a::DiscreteComponentCallback, b::DiscreteComponentCallback)
286286
_batchequal(a.kwargs, b.kwargs) || return false
287287
return true
288288
end
289-
function _batchequal(a::T, b::T) where {T <: Union{ComponentCondition, ComponentAffect}}
290-
typeof(a) == typeof(b)
289+
function _batchequal(a::ComponentCondition, b::ComponentCondition)
290+
typeof(a) == typeof(b) || return false
291+
a.f === b.f
291292
end
292293
function _batchequal(a::NamedTuple, b::NamedTuple)
293294
length(a) == length(b) || return false

0 commit comments

Comments
 (0)