Skip to content

Commit b88f62f

Browse files
fix dispatching into nothing handling
1 parent 8a08d26 commit b88f62f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/OrdinaryDiffEqCore/src/initialize_dae.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,25 @@ default_nlsolve(alg, isinplace, u, initprob, autodiff = false) = alg
111111

112112
## If the initialization is trivial just use nothing alg
113113
function default_nlsolve(
114-
::Nothing, isinplace, u::Nothing, ::NonlinearProblem, autodiff = false)
114+
::Nothing, isinplace::Val{true}, u::Nothing, ::NonlinearProblem, autodiff = false)
115115
nothing
116116
end
117117

118118
function default_nlsolve(
119-
::Nothing, isinplace, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
119+
::Nothing, isinplace::Val{true}, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
120120
nothing
121121
end
122122

123+
function default_nlsolve(
124+
::Nothing, isinplace::Val{false}, u::Nothing, ::NonlinearProblem, autodiff = false)
125+
nothing
126+
end
127+
128+
function default_nlsolve(
129+
::Nothing, isinplace::Val{false}, u::Nothing, ::NonlinearLeastSquaresProblem, autodiff = false)
130+
nothing
131+
end
132+
123133
function OrdinaryDiffEqCore.default_nlsolve(::Nothing, isinplace, u, ::NonlinearProblem, autodiff = false)
124134
error("This ODE requires a DAE initialization and thus a nonlinear solve but no nonlinear solve has been loaded. To solve this problem, do `using OrdinaryDiffEqNonlinearSolve` or pass a custom `nlsolve` choice into the `initializealg`.")
125135
end

0 commit comments

Comments
 (0)