Skip to content

Commit e852aa3

Browse files
authored
Restrictoplus to ElementarySpace (#265)
* restrict oplus to ElementarySpace * Add test
1 parent 5fa3a86 commit e852aa3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/spaces/vectorspaces.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ spaces `V₁`, `V₂`, ... Note that all the individual spaces should have the s
146146
[`isdual`](@ref), as otherwise the direct sum is not defined.
147147
"""
148148
function end
149-
(V₁::VectorSpace, V₂::VectorSpace) = (promote(V₁, V₂)...)
150-
(V::Vararg{VectorSpace}) = foldl(, V)
149+
(V₁::ElementarySpace, V₂::ElementarySpace) = (promote(V₁, V₂)...)
150+
(V::Vararg{ElementarySpace}) = foldl(, V)
151151
const oplus =
152152

153153
"""

test/spaces.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ println("------------------------------------")
323323
@test Base.eltype(P) == Base.eltype(typeof(P)) == typeof(V1)
324324
@test eltype(collect(P)) == typeof(V1)
325325
@test collect(P) == [V1, V2, V3, V4]
326+
@test_throws MethodError P P
326327
end
327328

328329
@timedtestset "ProductSpace{SU₂Space}" begin

0 commit comments

Comments
 (0)