Skip to content

Commit

Permalink
Fix BroadcastLayout{typeof(-)} ambiguity (#108)
Browse files Browse the repository at this point in the history
* Fix ambiguity with BroadcastLayout{typeof(-)}

* fix test
  • Loading branch information
dlfivefifty authored Jul 5, 2021
1 parent 594d81c commit 01f7bc8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ContinuumArrays"
uuid = "7ae1f121-cc2c-504b-ac30-9b923412ae5c"
version = "0.8.4"
version = "0.8.5"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
4 changes: 3 additions & 1 deletion src/bases/bases.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,10 @@ end
@inline copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(+)}}) = +(broadcast(\,Ref(L.A),arguments(L.B))...)
@inline copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(+)},<:Any,<:AbstractQuasiVector}) =
transform_ldiv(L.A, L.B)
@inline copy(L::Ldiv{Lay,BroadcastLayout{typeof(+)},<:Any,<:AbstractQuasiVector}) where Lay<:MappedBasisLayouts =
for op in (:+, :-)
@eval @inline copy(L::Ldiv{Lay,BroadcastLayout{typeof($op)},<:Any,<:AbstractQuasiVector}) where Lay<:MappedBasisLayouts =
copy(Ldiv{Lay,LazyLayout}(L.A,L.B))
end

@inline function copy(L::Ldiv{<:AbstractBasisLayout,BroadcastLayout{typeof(-)}})
a,b = arguments(L.B)
Expand Down
1 change: 1 addition & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ end

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

Expand Down

2 comments on commit 01f7bc8

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/40314

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.5 -m "<description of version>" 01f7bc8bc4ef4788cde8c7d5d95eb1f25f214ea3
git push origin v0.8.5

Please sign in to comment.