diff --git a/Project.toml b/Project.toml index 4dee948..e6f7a0b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "RandomExtensions" uuid = "fb686558-2515-59ef-acaa-46db3789a887" authors = ["Rafael Fourquet "] -version = "0.4.3" +version = "0.4.4" [deps] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/src/sampling.jl b/src/sampling.jl index e3743fa..3070eee 100644 --- a/src/sampling.jl +++ b/src/sampling.jl @@ -228,6 +228,17 @@ Sampler(::Type{RNG}, ::Type{T}, n::Repetition ) where {RNG<:AbstractRNG,T<:Union{Tuple,NamedTuple}} = Sampler(RNG, make(T), n) +if VERSION >= v"1.11.0-DEV.573" + # now `Random` implements `rand(Tuple{...})`, so be more specific for + # special stuff still not implemented by `Random` + # TODO: we should probably remove this + Sampler(::Type{RNG}, ::Type{Tuple}, n::Repetition) where {RNG <: AbstractRNG} = + Sampler(RNG, make(Tuple), n) + + Sampler(::Type{RNG}, ::Type{NTuple{N}}, n::Repetition) where {RNG <: AbstractRNG, N} = + Sampler(RNG, make(NTuple{N}), n) +end + #### make # implement make(Tuple, S1, S2...), e.g. for rand(make(Tuple, Int, 1:3)),