Skip to content

Commit 3348817

Browse files
authored
Avoid ambiguity in _broadcast_mul_ldiv (#111)
* Avoid ambiguity in _broadcast_mul_ldiv * Update runtests.jl * v0.8.7
1 parent 3ce3c24 commit 3348817

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
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.6"
3+
version = "0.8.7"
44

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

src/bases/bases.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ function _broadcast_mul_ldiv(::Tuple{ScalarLayout,Any}, A, B)
132132
a * (A \ b)
133133
end
134134

135+
function _broadcast_mul_ldiv(::Tuple{ScalarLayout,ApplyLayout{typeof(*)}}, A, B)
136+
a,b = arguments(B)
137+
a * (A \ b)
138+
end
139+
135140
_broadcast_mul_ldiv(::Tuple{ScalarLayout,AbstractBasisLayout}, A, B) =
136141
_broadcast_mul_ldiv((ScalarLayout(),UnknownLayout()), A, B)
137142
_broadcast_mul_ldiv(_, A, B) = copy(Ldiv{typeof(MemoryLayout(A)),UnknownLayout}(A,B))

test/runtests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ end
141141
@test 2f == f*2 == 2 .* f == f .* 2
142142
@test 2\f == f/2 == 2 .\ f == f ./ 2
143143
@test sum(f) 4.5
144+
@test L \ BroadcastQuasiArray(*,2,f) [2,4,8]
144145
end
145146
end
146147

0 commit comments

Comments
 (0)