From b09145438ee2f63681376df0afba3794a3990ba7 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sun, 7 Aug 2022 16:30:22 +0530 Subject: [PATCH] UnsetSpace compatibility --- src/Space.jl | 2 ++ test/SpacesTest.jl | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/Space.jl b/src/Space.jl index a5c9a9f2..843044a3 100644 --- a/src/Space.jl +++ b/src/Space.jl @@ -114,6 +114,8 @@ canonicaldomain(S::Space) = canonicaldomain(domain(S)) # This is used in place of == to support AnyDomain spacescompatible(f::D,g::D) where D<:Space = error("Override spacescompatible for "*string(D)) spacescompatible(::UnsetSpace,::UnsetSpace) = true +spacescompatible(::Space, ::UnsetSpace) = true +spacescompatible(::UnsetSpace, ::Space) = true spacescompatible(::NoSpace,::NoSpace) = true spacescompatible(f,g) = false ==(A::Space,B::Space) = spacescompatible(A,B) && domain(A) == domain(B) diff --git a/test/SpacesTest.jl b/test/SpacesTest.jl index 09c455f8..0e39593d 100644 --- a/test/SpacesTest.jl +++ b/test/SpacesTest.jl @@ -173,5 +173,10 @@ using ApproxFunOrthogonalPolynomials v = rand(4) v2 = transform(NormalizedChebyshev(), v) @test itransform(NormalizedChebyshev(), v2) ≈ v + + @testset "ApproxFun.jl issue 616" begin + x, D = Fun(), Derivative(Chebyshev()) + @test (D*Multiplication(x)*D)*x ≈ 1 + end end end