Skip to content

Commit 9a61bd7

Browse files
Use const DEFAULT_VERBOSE for Julia 1.10 LTS compatibility
Added const DEFAULT_VERBOSE to ensure the default verbose value is always the same concrete instance, which should improve type stability on Julia 1.10 LTS. This ensures that when verbose=true is passed, the compiler can see it's always the same concrete LinearVerbosity instance across all call sites, making it easier to infer the return type.
1 parent bea9ad5 commit 9a61bd7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/common.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ default_alias_b(::AbstractSparseFactorization, ::Any, ::Any) = true
232232

233233
DEFAULT_PRECS(A, p) = IdentityOperator(size(A)[1]), IdentityOperator(size(A)[2])
234234

235+
# Default verbose setting (const for type stability)
236+
const DEFAULT_VERBOSE = LinearVerbosity()
237+
235238
# Helper functions for processing verbose parameter with multiple dispatch (type-stable)
236239
@inline _process_verbose_param(verbose::LinearVerbosity) = (verbose, verbose)
237240
@inline function _process_verbose_param(verbose::SciMLLogging.AbstractVerbosityPreset)
@@ -240,7 +243,7 @@ DEFAULT_PRECS(A, p) = IdentityOperator(size(A)[1]), IdentityOperator(size(A)[2])
240243
end
241244
@inline function _process_verbose_param(verbose::Bool)
242245
# @warn "Using `true` or `false` for `verbose` is being deprecated."
243-
verbose_spec = verbose ? LinearVerbosity() : LinearVerbosity(SciMLLogging.None())
246+
verbose_spec = verbose ? DEFAULT_VERBOSE : LinearVerbosity(SciMLLogging.None())
244247
return (verbose_spec, verbose)
245248
end
246249

0 commit comments

Comments
 (0)