Skip to content

Commit

Permalink
fix ambiguity for range generation in Julia 1.5 (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet authored May 2, 2020
1 parent cc72c6c commit 48c122d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/StableRNGs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ function rand(rng::LehmerRNG, sp::SamplerRangeFast{UInt128,T}) where T
x % T + a
end

Sampler(::Type{LehmerRNG}, r::AbstractUnitRange{T}, ::Random.Repetition
) where {T<:BitInteger} =
SamplerRangeFast(r)
for T in Base.BitInteger_types
# eval because of ambiguities with `where T <: BitInteger`
@eval Sampler(::Type{LehmerRNG}, r::AbstractUnitRange{$T}, ::Random.Repetition) =
SamplerRangeFast(r)
end


end # module

0 comments on commit 48c122d

Please sign in to comment.