Skip to content

Commit e383450

Browse files
committed
rand(Pair{X, Y}) is now implemented in Random
1 parent f5d9723 commit e383450

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/sampling.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,10 @@ rand(rng::AbstractRNG, sp::SamplerTag{Cont{T}}) where {T<:Union{Pair,Complex}} =
206206
#### additional convenience methods
207207

208208
# rand(Pair{A,B}) => rand(make(Pair{A,B}, A, B))
209-
Sampler(::Type{RNG}, ::Type{Pair{A,B}}, n::Repetition) where {RNG<:AbstractRNG,A,B} =
210-
Sampler(RNG, make(Pair{A,B}, A, B), n)
209+
if VERSION < v"1.11.0-DEV.618" # now implemented in `Random`
210+
Sampler(::Type{RNG}, ::Type{Pair{A,B}}, n::Repetition) where {RNG<:AbstractRNG,A,B} =
211+
Sampler(RNG, make(Pair{A,B}, A, B), n)
212+
end
211213

212214
# rand(make(Complex, x)) => rand(make(Complex, x, x))
213215
Sampler(::Type{RNG}, u::Make1{T}, n::Repetition) where {RNG<:AbstractRNG,T<:Complex} =

0 commit comments

Comments
 (0)