@@ -116,8 +116,8 @@ function SciMLBase.ODEFunction{iip, spec}(
116116 return odefn
117117end
118118
119- Base. @nospecializeinfer @fallback_iip_specialize function SciMLBase . ODEProblem {iip, spec} (
120- sys:: System , @nospecialize (op), tspan;
119+ Base. @nospecializeinfer function _ode_problem (
120+ :: Type{ODEProblem{iip, spec}} , sys:: System , @nospecialize (op), tspan;
121121 @nospecialize (callback = nothing ), check_length = true , eval_expression = false ,
122122 expression = Val{false }, eval_module = @__MODULE__ , check_compatibility = true ,
123123 _skip_events = false , kwargs...
@@ -146,7 +146,36 @@ Base.@nospecializeinfer @fallback_iip_specialize function SciMLBase.ODEProblem{i
146146
147147 ptype = getmetadata (sys, ProblemTypeCtx, StandardODEProblem ())
148148 args = (; f, u0, tspan, p, ptype)
149- maybe_codegen_scimlproblem (expression, ODEProblem{_iip}, args; kwargs... )
149+ return maybe_codegen_scimlproblem (expression, ODEProblem{_iip}, args; kwargs... )
150+ end
151+
152+ Base. @nospecializeinfer @fallback_iip_specialize function SciMLBase. ODEProblem {iip, spec} (
153+ sys:: System , @nospecialize (op), tspan;
154+ @nospecialize (callback = nothing ), check_length = true , eval_expression = false ,
155+ expression = Val{false }, eval_module = @__MODULE__ , check_compatibility = true ,
156+ _skip_events = false , kwargs...
157+ ) where {iip, spec}
158+ return _ode_problem (
159+ ODEProblem{iip, spec}, sys, op, tspan;
160+ callback, check_length, eval_expression, expression, eval_module, check_compatibility,
161+ _skip_events, kwargs...
162+ )
163+ end
164+
165+ # SciMLBase also defines this fixed-specialization constructor for arbitrary functions.
166+ Base. @nospecializeinfer function SciMLBase. ODEProblem{
167+ iip, SciMLBase. FunctionWrapperSpecialize,
168+ }(
169+ sys:: System , @nospecialize (op), tspan;
170+ @nospecialize (callback = nothing ), check_length = true , eval_expression = false ,
171+ expression = Val{false }, eval_module = @__MODULE__ , check_compatibility = true ,
172+ _skip_events = false , kwargs...
173+ ) where {iip}
174+ return _ode_problem (
175+ ODEProblem{iip, SciMLBase. FunctionWrapperSpecialize}, sys, op, tspan;
176+ callback, check_length, eval_expression, expression, eval_module, check_compatibility,
177+ _skip_events, kwargs...
178+ )
150179end
151180
152181@fallback_iip_specialize function DiffEqBase. SteadyStateProblem {iip, spec} (
0 commit comments