diff --git a/src/problems/implicit_discrete_problems.jl b/src/problems/implicit_discrete_problems.jl index 30a3a3eb2..ae892e239 100644 --- a/src/problems/implicit_discrete_problems.jl +++ b/src/problems/implicit_discrete_problems.jl @@ -78,7 +78,7 @@ struct ImplicitDiscreteProblem{uType, tType, isinplace, P, F, K} <: tspan::tType """The parameter values of the function.""" p::P - """ A callback to be applied to every solver which uses the problem.""" + """A callback to be applied to every solver which uses the problem.""" kwargs::K @add_kwonly function ImplicitDiscreteProblem{iip}(f::ImplicitDiscreteFunction{ iip, @@ -120,6 +120,17 @@ function ImplicitDiscreteProblem(f, u0, tspan, p = NullParameters(); ImplicitDiscreteProblem(ImplicitDiscreteFunction{iip}(f), u0, tspan, p; kwargs...) end +function ConstructionBase.constructorof(::Type{P}) where {P <: ImplicitDiscreteProblem} + function ctor(f, u0, tspan, p, kw) + if f isa AbstractDiscreteFunction + iip = isinplace(f) + else + iip = isinplace(f, 5) + end + return ImplicitDiscreteProblem{iip}(f, u0, tspan, p; kw...) + end +end + @doc doc""" Holds information on what variables to alias diff --git a/test/downstream/modelingtoolkit_remake.jl b/test/downstream/modelingtoolkit_remake.jl index ead791866..7f1a715e7 100644 --- a/test/downstream/modelingtoolkit_remake.jl +++ b/test/downstream/modelingtoolkit_remake.jl @@ -82,6 +82,7 @@ push!(probs, discprob) [0 ~ x^3 * β + y^3 * ρ - σ, 0 ~ x^2 + 2x * y + y^2, 0 ~ z^2 - 4z + 4], [x, y, z], [σ, β, ρ]) sccprob = SCCNonlinearProblem(sys, u0, p) +@test_nowarn SciMLBase.initialization_status(sccprob) push!(syss, sys) push!(probs, sccprob)