Skip to content

Commit b966b9b

Browse files
Add a preferences version
1 parent 62b4b1b commit b966b9b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/config.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,9 @@ Base.eltype(cfg::AbstractConfig) = eltype(typeof(cfg))
104104
@inline (chunksize(::AbstractConfig{N})::Int) where {N} = N
105105

106106
function maketag(tagstyle::Union{Symbol,Nothing}, f, X)
107-
@static if VERSION v"1.11"
107+
if HASHTAG_MODE_ENABLED
108108
return HashTag(f, X)
109109
else
110-
# On ≤1.10, the hash of a type cannot be computed at compile-time,
111-
# making `HashTag(...)` type-unstable, so `Tag(...)` is left as
112-
# as the default.
113110
return Tag(f, X)
114111
end
115112
end

src/prelude.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
const NANSAFE_MODE_ENABLED = @load_preference("nansafe_mode", false)
22
const DEFAULT_CHUNK_THRESHOLD = @load_preference("default_chunk_threshold", 12)
33

4+
# On ≤1.10, the hash of a type cannot be computed at compile-time,
5+
# making `HashTag(...)` type-unstable, so `Tag(...)` is left as
6+
# as the default.
7+
const HASHTAG_MODE_ENABLED = @load_preference("hashtag_mode", VERSION v"1.11")
8+
49
const AMBIGUOUS_TYPES = (AbstractFloat, Irrational, Integer, Rational, Real, RoundingMode)
510

611
const UNARY_PREDICATES = Symbol[:isinf, :isnan, :isfinite, :iseven, :isodd, :isreal, :isinteger]

0 commit comments

Comments
 (0)