Skip to content

Commit fb3a3d5

Browse files
Merge pull request #478 from ChrisRackauckas-Claude/fix-deverbosity-dispatch
Fix precompile MethodError when DiffEqBase DEVerbosity flows through as default verbose
2 parents 9aaa4cf + 34d4217 commit fb3a3d5

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/BoundaryValueDiffEqCore/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "BoundaryValueDiffEqCore"
22
uuid = "56b672f2-a5fe-4263-ab2d-da677488eb3a"
3-
version = "2.3.0"
3+
version = "2.3.1"
44
authors = ["Qingyu Qu <erikqqy123@gmail.com>"]
55

66
[deps]

lib/BoundaryValueDiffEqCore/src/verbosity.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,10 @@ end
355355
end
356356

357357
@inline _process_verbose_param(verbose::BVPVerbosity) = verbose
358+
359+
# A foreign AbstractVerbositySpecifier (e.g. DiffEqBase.DEVerbosity) can flow in
360+
# through DiffEqBase's `solve`/`init` default kwargs (`verbose = DEFAULT_VERBOSE`,
361+
# which is a `DEVerbosity`). BVPVerbosity's toggles differ from DEVerbosity's, so
362+
# we cannot meaningfully translate it; fall back to BVP's own default rather than
363+
# dispatch-missing at precompile time.
364+
@inline _process_verbose_param(::SciMLLogging.AbstractVerbositySpecifier) = DEFAULT_VERBOSE

lib/BoundaryValueDiffEqCore/test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,15 @@ using InteractiveUtils, Test
1111
Aqua.test_piracies(BoundaryValueDiffEqCore)
1212
Aqua.test_ambiguities(BoundaryValueDiffEqCore; recursive = false)
1313
end
14+
15+
@testset "_process_verbose_param foreign AbstractVerbositySpecifier" begin
16+
# DiffEqBase.DEVerbosity is a foreign AbstractVerbositySpecifier that
17+
# can flow in via DiffEqBase's `solve`/`init` default `verbose` kwarg.
18+
# It must not hit a MethodError at precompile time; it should fall
19+
# back to BVP's own DEFAULT_VERBOSE (a BVPVerbosity).
20+
using BoundaryValueDiffEqCore, DiffEqBase
21+
result = BoundaryValueDiffEqCore._process_verbose_param(DiffEqBase.DEFAULT_VERBOSE)
22+
@test result isa BoundaryValueDiffEqCore.BVPVerbosity
23+
@test result === BoundaryValueDiffEqCore.DEFAULT_VERBOSE
24+
end
1425
end

0 commit comments

Comments
 (0)