diff --git a/src/Interfaces/LazySet.jl b/src/Interfaces/LazySet.jl index a5050303ba..c3ba260104 100644 --- a/src/Interfaces/LazySet.jl +++ b/src/Interfaces/LazySet.jl @@ -658,7 +658,11 @@ end function _an_element_lazySet(X::LazySet) N = eltype(X) e₁ = SingleEntryVector(1, dim(X), one(N)) - return σ(e₁, X) + v = σ(e₁, X) + if any(isinf, v) + throw(ArgumentError("this implementation assumes a bounded set")) + end + return v end # hook into random API diff --git a/test/Sets/Universe.jl b/test/Sets/Universe.jl index a3ce44cc8b..5ce71b5b22 100644 --- a/test/Sets/Universe.jl +++ b/test/Sets/Universe.jl @@ -130,6 +130,9 @@ for N in [Float64, Rational{Int}, Float32] scale!(N(1), U2) @test U2 == U @test_throws ArgumentError scale!(N(0), U2) + + # an_element default implementation + @test_throws ArgumentError LazySets._an_element_lazySet(U) end # default Float64 constructor