Skip to content

Commit

Permalink
Fix type stability of iposint and inegint
Browse files Browse the repository at this point in the history
Due to missing specialization, these integrated shrinkers were
type unstable.
  • Loading branch information
Seelengrab committed Aug 13, 2023
1 parent af06308 commit ce55fea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/generators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ generate(rng, ::Type{String}) = randstring(rng, typemin(Char):"\xf7\xbf\xbf\xbf"
An integrated shrinker producing positive values of type `T`.
"""
iposint(T::Type{<:Base.BitSigned}) = map(itype(T)) do v
iposint(::Type{T}) where T <:Base.BitSigned = map(itype(T)) do v
v & typemax(T)
end

Expand All @@ -62,7 +62,7 @@ end
An integrated shrinker producing negative values of type `T`.
"""
inegint(T::Type{<:Base.BitSigned}) = map(itype(T)) do v
inegint(::Type{T}) where T <:Base.BitSigned = map(itype(T)) do v
v | ~typemax(T)
end

Expand Down

0 comments on commit ce55fea

Please sign in to comment.