Skip to content

Commit 87e5e28

Browse files
authored
Fix some call with empty domain argument (#52)
* Fixes EmptyDomain stuff * Fix format
1 parent 30ba01d commit 87e5e28

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/common.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ domain_size(d::D) where {D<:AbstractDomain} = length(d)
5454
Access the internal structure of any domain type.
5555
"""
5656
get_domain(d::D) where {D<:AbstractDomain} = d.domain
57+
get_domain(::EmptyDomain) = []
5758

5859
"""
5960
to_domains(args...)
@@ -76,6 +77,8 @@ Extends `Base.rand` to (a collection of) domains.
7677
"""
7778
Base.rand(d::AbstractDomain) = rand(get_domain(d))
7879

80+
Base.rand(::EmptyDomain) = nothing
81+
7982
Base.rand(d::Union{Vector{D},Set{D}}) where {D<:AbstractDomain} = map(rand, d)
8083

8184
function Base.rand(

0 commit comments

Comments
 (0)