Skip to content

Commit

Permalink
bug in ProductDomain constructor with SVector list of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
daanhb committed Jun 20, 2024
1 parent 952975a commit 3b941f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/generic/productdomain.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ ProductDomain(domains...) = _ProductDomain(domains, map(domaineltype, domains)..
_ProductDomain(domains, types...) = TupleProductDomain(domains...)
_ProductDomain(domains, types::VcatEltype...) = VcatDomain(domains...)
ProductDomain(domains::AbstractVector) = VectorProductDomain(domains)
ProductDomain(domains::StaticVector) = ProductDomain(domains...)
# To create a tuple product domain, invoke ProductDomain{T}. Here, we splat
# and this may end up creating a VcatDomain instead.
ProductDomain(domains::Tuple) = ProductDomain(domains...)
Expand Down
2 changes: 2 additions & 0 deletions test/test_domain_product.jl
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ function test_product_domains()
@test String(take!(io)) == "($(0..1)) × ($(0..2)) × ($(0..3)) × ... × ($(0..20))"
@test isopenset(interior(UnitCube()))
@test isclosedset(closure(interior(UnitCube())))

@test ProductDomain(SVector(0..1.0, Point(0.5))) isa VcatDomain
end
@testset "bounding box" begin
@test boundingbox([0.2, -0.4, 1.0]) == -0.4..1.0
Expand Down

0 comments on commit 3b941f8

Please sign in to comment.