Skip to content

Commit a252d31

Browse files
committed
Fix type instability
1 parent 8c0a53a commit a252d31

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/remake.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function remake(prob::ODEProblem; f = missing,
229229

230230
iip = isinplace(prob)
231231

232-
if build_initializeprob == Val{true} || build_initializeprob == true
232+
if build_initializeprob isa Val{true} || build_initializeprob == true
233233
if f !== missing && has_initialization_data(f)
234234
initialization_data = remake_initialization_data(
235235
prob.f.sys, f, u0, tspan[1], p, newu0, newp)

test/downstream/solution_interface.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,3 +349,10 @@ end
349349
sol = solve(prob)
350350
@test sol(0.6, idxs = y) 2.0
351351
end
352+
353+
@testset "Type stability of MTK workflow" begin
354+
@variables x(t)
355+
@mtkbuild sys = ODESystem([D(x) ~ 0.0], t; defaults = [x => 0.0])
356+
prob = ODEProblem(sys, [], (0.0, 1.0))
357+
@test_nowarn @inferred solve(prob, Tsit5())
358+
end

0 commit comments

Comments
 (0)