From ce55fea6e65e7e94bf71422707eaf48535a03775 Mon Sep 17 00:00:00 2001 From: Sukera Date: Sun, 13 Aug 2023 10:35:14 +0200 Subject: [PATCH] Fix type stability of `iposint` and `inegint` Due to missing specialization, these integrated shrinkers were type unstable. --- src/generators.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/generators.jl b/src/generators.jl index f186552..4f832b9 100644 --- a/src/generators.jl +++ b/src/generators.jl @@ -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 @@ -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