Skip to content

Commit 01f7bc8

Browse files
authored
Fix BroadcastLayout{typeof(-)} ambiguity (#108)
* Fix ambiguity with BroadcastLayout{typeof(-)} * fix test
1 parent 594d81c commit 01f7bc8

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ContinuumArrays"
22
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
3-
version = "0.8.4"
3+
version = "0.8.5"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/bases/bases.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ end
5959
@inline copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(+)}}) = +(broadcast(\,Ref(L.A),arguments(L.B))...)
6060
@inline copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(+)},<:Any,<:AbstractQuasiVector}) =
6161
transform_ldiv(L.A, L.B)
62-
@inline copy(L::Ldiv{Lay,BroadcastLayout{typeof(+)},<:Any,<:AbstractQuasiVector}) where Lay<:MappedBasisLayouts =
62+
for op in (:+, :-)
63+
@eval @inline copy(L::Ldiv{Lay,BroadcastLayout{typeof($op)},<:Any,<:AbstractQuasiVector}) where Lay<:MappedBasisLayouts =
6364
copy(Ldiv{Lay,LazyLayout}(L.A,L.B))
65+
end
6466

6567
@inline function copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(-)}})
6668
a,b = arguments(L.B)

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@ end
450450

451451
@testset "Mapped and BroadcastLayout{typeof(+)}" begin
452452
@test L[y,:] \ (y .+ y) L[y,:] \ (2y)
453+
@test L[y,:] \ (y .- y) zeros(10)
453454
end
454455
end
455456

0 commit comments

Comments
 (0)