diff --git a/lib/OrdinaryDiffEqCore/src/solve.jl b/lib/OrdinaryDiffEqCore/src/solve.jl index b9fdf3e0f2..0de89bc5ad 100644 --- a/lib/OrdinaryDiffEqCore/src/solve.jl +++ b/lib/OrdinaryDiffEqCore/src/solve.jl @@ -760,7 +760,7 @@ Base.@constprop :aggressive function _ode_init( controller_cache = setup_controller_cache(_alg, cache, controller, EEstT, disco_probs) is_disco_step = false - disco_checkpoint = zero(tType) + disco_checkpoint = zero(t) # Seed the initial EEst on the controller cache (was previously # `integrator.EEst = oneunit(EEstT)`). set_EEst!(controller_cache, EEst) diff --git a/test/Downstream/dynamicquantities_measurements.jl b/test/Downstream/dynamicquantities_measurements.jl index 5e00142337..21c8d87534 100644 --- a/test/Downstream/dynamicquantities_measurements.jl +++ b/test/Downstream/dynamicquantities_measurements.jl @@ -10,7 +10,11 @@ using Test f(u, p, t) = u / (1u"s") prob = ODEProblem(f, u0, tspan) - sol = solve(prob, Tsit5(); abstol = 1.0e-9, reltol = 1.0e-9) + integrator = init(prob, Tsit5(); abstol = 1.0e-9, reltol = 1.0e-9) + @test integrator.disco_checkpoint == zero(first(tspan)) + @test typeof(integrator.disco_checkpoint) == typeof(first(tspan)) + + sol = solve!(integrator) @test sol.u[end] isa typeof(u0) @test eltype(sol.u) == typeof(u0)