I didn’t know that callback function could be type unstable, since everything seems to be pre-defined. But here’s the @code_warntype output (seems like type stable to me):
Variables
#self#::Type{VectorContinuousCallback}
condition::Core.Compiler.Const(condition, false)
affect!::Core.Compiler.Const(affect!, false)
affect_neg!::Core.Compiler.Const(nothing, false)
len::Int64
Body::VectorContinuousCallback{typeof(condition),typeof(affect!),Nothing,typeof(DiffEqBase.INITIALIZE_DEFAULT),typeof(DiffEqBase.FINALIZE_DEFAULT),Float64,Int64,Rational{Int64},Nothing,Int64}
1 ─ %1 = Core.tuple(true, true)::Core.Compiler.Const((true, true), false)
│ %2 = DiffEqBase.eps()::Core.Compiler.Const(2.220446049250313e-16, false)
│ %3 = (10 * %2)::Core.Compiler.Const(2.220446049250313e-15, false)
│ %4 = (1 // 100)::Rational{Int64}
│ %5 = DiffEqBase.:(var"#VectorContinuousCallback#21")(DiffEqBase.INITIALIZE_DEFAULT, DiffEqBase.FINALIZE_DEFAULT, DiffEqBase.nothing, DiffEqBase.LeftRootFind, %1, 10, 1, %3, 0, %4, #self#, condition, affect!, affect_neg!, len)::VectorContinuousCallback{typeof(condition),typeof(affect!),Nothing,typeof(DiffEqBase.INITIALIZE_DEFAULT),typeof(DiffEqBase.FINALIZE_DEFAULT),Float64,Int64,Rational{Int64},Nothing,Int64}
└── return %5