Skip to content

Commit 9e06124

Browse files
authored
Fix error message for unimplemented domain/rangespace (#634)
1 parent 023b1a4 commit 9e06124

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/Operators/Operator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ opissymmetric(::OperatorStyle, A) = false
197197
for f in [:domainspace, :rangespace]
198198
opf = Symbol(:op, f)
199199
@eval begin
200-
$opf(::OperatorStyle, A) = error("Override domainspace for $(typeof(A))")
200+
$opf(::OperatorStyle, A) = error("Override $($f) for $(typeof(A))")
201201
$opf(S::StyleConflict, A) = $opf(dominantstyle(S, $f, A), A)
202202
end
203203
end

test/runtests.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -793,3 +793,10 @@ include("show.jl")
793793

794794
@test @inferred(chebyshev_clenshaw(BigInt[1], 1)) == 1
795795
end
796+
797+
@testset "Unimplemented functionality errors" begin
798+
struct MyOperator{T} <: ApproxFunBase.Operator{T} end
799+
X = MyOperator{Float64}();
800+
@test_throws ErrorException("Override domainspace for $(typeof(X))") domainspace(X)
801+
@test_throws ErrorException("Override rangespace for $(typeof(X))") rangespace(X)
802+
end

0 commit comments

Comments
 (0)