From 0c86fe160d831decd7d9014259e4542f827a0c8b Mon Sep 17 00:00:00 2001 From: Jutho Date: Fri, 5 Jan 2024 18:36:31 +0100 Subject: [PATCH] fix ambiguity on Julia1.6 --- src/spaces/cartesianspace.jl | 2 +- src/spaces/complexspace.jl | 2 +- src/spaces/generalspace.jl | 2 +- src/spaces/vectorspaces.jl | 3 --- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/spaces/cartesianspace.jl b/src/spaces/cartesianspace.jl index bca3f854..834688a4 100644 --- a/src/spaces/cartesianspace.jl +++ b/src/spaces/cartesianspace.jl @@ -40,7 +40,7 @@ Base.:^(::RealNumbers, d::Int) = CartesianSpace(d) # Corresponding methods: #------------------------ -dim(V::CartesianSpace) = V.d +dim(V::CartesianSpace, s::Trivial = Trivial()) = V.d Base.axes(V::CartesianSpace) = Base.OneTo(dim(V)) Base.oneunit(::Type{CartesianSpace}) = CartesianSpace(1) diff --git a/src/spaces/complexspace.jl b/src/spaces/complexspace.jl index 44e3fd02..72314352 100644 --- a/src/spaces/complexspace.jl +++ b/src/spaces/complexspace.jl @@ -38,7 +38,7 @@ Base.:^(::ComplexNumbers, d::Int) = ComplexSpace(d) # Corresponding methods: #------------------------ -dim(V::ComplexSpace) = V.d +dim(V::ComplexSpace, s::Trivial = Trivial()) = V.d isdual(V::ComplexSpace) = V.dual Base.axes(V::ComplexSpace) = Base.OneTo(dim(V)) diff --git a/src/spaces/generalspace.jl b/src/spaces/generalspace.jl index 8f9e9ab3..efef1b57 100644 --- a/src/spaces/generalspace.jl +++ b/src/spaces/generalspace.jl @@ -23,7 +23,7 @@ function GeneralSpace{𝕜}(d::Int=0; dual::Bool=false, conj::Bool=false) where return GeneralSpace{𝕜}(d, dual, conj) end -dim(V::GeneralSpace) = V.d +dim(V::GeneralSpace, s::Trivial = Trivial()) = V.d isdual(V::GeneralSpace) = V.dual isconj(V::GeneralSpace) = V.conj diff --git a/src/spaces/vectorspaces.jl b/src/spaces/vectorspaces.jl index bc57dabc..8ad0bb36 100644 --- a/src/spaces/vectorspaces.jl +++ b/src/spaces/vectorspaces.jl @@ -229,9 +229,6 @@ Base.axes(V::ElementarySpace, ::Trivial) = axes(V) Return an iterator over the different sectors of `V`. """ sectors(V::ElementarySpace) = OneOrNoneIterator(dim(V) != 0, Trivial()) -function dim(V::ElementarySpace, ::Trivial) - return sectortype(V) == Trivial ? dim(V) : throw(SectorMismatch()) -end # Composite vector spaces #-------------------------