204204 if isempty (args)
205205 TT = T === Tuple ? Tuple{} :
206206 T === NTuple ? Tuple{} :
207- T isa UnionAll && Type{T} <: Type{NTuple{N}} where N ? T{default_sampling (Tuple)} :
207+ T isa UnionAll && Type{T} <: Type{NTuple{N}} where N ? T{default_gentype (Tuple)} :
208208 T
209209 return :(Make0 {$TT} ())
210210 end
@@ -234,7 +234,7 @@ make(T::Type{<:Tuple}, args...) = _make(T, args...)
234234
235235# make(Tuple, X, n::Integer)
236236
237- default_sampling (:: Type{Tuple} ) = Float64
237+ default_sampling (:: Type{Tuple} ) = Uniform ( Float64)
238238
239239make (:: Type{Tuple} , X, n:: Integer ) = make (NTuple{Int (n)}, X)
240240make (:: Type{Tuple} , :: Type{X} , n:: Integer ) where {X} = make (NTuple{Int (n)}, X)
310310
311311# ## sets
312312
313- default_sampling (:: Type{<:AbstractSet} ) = Float64
314- default_sampling (:: Type{<:AbstractSet{T}} ) where {T} = T
313+ default_sampling (:: Type{<:AbstractSet} ) = Uniform ( Float64)
314+ default_sampling (:: Type{<:AbstractSet{T}} ) where {T} = Uniform (T)
315315
316316# ### Set
317317
@@ -320,7 +320,7 @@ find_type(::Type{Set{T}}, _, _) where {T} = Set{T}
320320
321321# ## BitSet
322322
323- default_sampling (:: Type{BitSet} ) = Int8 # almost arbitrary, may change
323+ default_sampling (:: Type{BitSet} ) = Uniform ( Int8) # almost arbitrary, may change
324324
325325find_type (:: Type{BitSet} , _, _) = BitSet
326326
@@ -329,7 +329,7 @@ find_type(::Type{BitSet}, _, _) = BitSet
329329
330330# again same inference bug
331331# TODO : extend to AbstractDict ? (needs to work-around the inderence bug)
332- default_sampling (:: Type{Dict{K,V}} ) where {K,V} = Pair{K,V}
332+ default_sampling (:: Type{Dict{K,V}} ) where {K,V} = Uniform ( Pair{K,V})
333333default_sampling (D:: Type{<:Dict} ) = throw (ArgumentError (" under-specified scalar type for $D " ))
334334
335335find_type (D:: Type{<:AbstractDict{K,V}} , _, :: Integer ) where {K,V} = D
@@ -344,8 +344,8 @@ find_type(::Type{Dict}, X, ::Integer) = Dict{fieldtype(va
344344
345345# ## AbstractArray
346346
347- default_sampling (:: Type{<:AbstractArray{T}} ) where {T} = T
348- default_sampling (:: Type{<:AbstractArray} ) = Float64
347+ default_sampling (:: Type{<:AbstractArray{T}} ) where {T} = Uniform (T)
348+ default_sampling (:: Type{<:AbstractArray} ) = Uniform ( Float64)
349349
350350make (A:: Type{<:AbstractArray} , X, dims:: Integer... ) = make (A, X, Dims (dims))
351351make (A:: Type{<:AbstractArray} , :: Type{X} , dims:: Integer... ) where {X} = make (A, X, Dims (dims))
@@ -363,9 +363,6 @@ rand(rng::AbstractRNG, sp::SamplerTag{A}) where {A<:AbstractArray} =
363363
364364# ### Array
365365
366- val_gentype (X) = gentype (X)
367- val_gentype (:: Type{X} ) where {X} = X
368-
369366# cf. inference bug https://github.com/JuliaLang/julia/issues/28762
370367# we have to write out all combinations for getting proper inference
371368find_type (A:: Type{Array{T}} , _, :: Dims{N} ) where {T, N} = Array{T, N}
@@ -376,7 +373,7 @@ find_type(A::Type{Array}, X, ::Dims{N}) where {N} = Array{val_ge
376373
377374# ### BitArray
378375
379- default_sampling (:: Type{<:BitArray} ) = Bool
376+ default_sampling (:: Type{<:BitArray} ) = Uniform ( Bool)
380377
381378find_type (:: Type{BitArray{N}} , _, :: Dims{N} ) where {N} = BitArray{N}
382379find_type (:: Type{BitArray} , _, :: Dims{N} ) where {N} = BitArray{N}
0 commit comments