Skip to content

Commit f138a2b

Browse files
Merge pull request #1219 from ChrisRackauckas-Claude/fix-subarray-functionwrapper-issue-2900
Fix SubArray FunctionWrapper type mismatch
2 parents af59ae9 + ab26c7c commit f138a2b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/solve.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,8 @@ function promote_f(f::F, ::Val{specialize}, u0, p, t) where {F, specialize}
688688
f.mass_matrix isa UniformScaling &&
689689
# Jacobians don't wrap, so just ignore those cases
690690
f.jac === nothing &&
691+
# Opt-out SubArrays since they would create type mismatches with the integrator's internal Arrays
692+
!(u0 isa SubArray) &&
691693
((specialize === SciMLBase.AutoSpecialize && eltype(u0) !== Any &&
692694
RecursiveArrayTools.recursive_unitless_eltype(u0) === eltype(u0) &&
693695
one(t) === oneunit(t) && hasdualpromote(u0, t)) ||

0 commit comments

Comments
 (0)