Skip to content

Commit 1e78c22

Browse files
authored
Fix Fun show on union of Points (#470)
1 parent 5e9fbd8 commit 1e78c22

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/show.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
evalconst(f, ::AnyDomain) = f(0.0)
1414
evalconst(f, d) = f(leftendpoint(d))
15-
evalconst(f, d::Point) = f(d)
15+
evalconst(f, d::Union{Point, UnionDomain{<:Any, <:Tuple{Point, Vararg{Point}}}}) = f(d)
1616

1717
function show(io::IO,f::Fun{<:Union{ConstantSpace, ArraySpace{<:ConstantSpace}}})
1818
d = domain(f)

test/show.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@
5454
@test contains(repr(f), repr(f(0)))
5555

5656
f = Fun(1, ConstantSpace(Point(3)))
57-
@test contains(repr(f), repr(Point(3)))
57+
@test contains(repr(f), repr(domain(f)))
58+
@test contains(repr(f), repr(1))
59+
60+
f = Fun(1, ConstantSpace(Point(3) Point(4)))
61+
@test contains(repr(f), repr(domain(f)))
5862
@test contains(repr(f), repr(1))
5963
end
6064
@testset "Operator" begin

0 commit comments

Comments
 (0)