Skip to content

Commit 1a9746c

Browse files
authored
Disambiguate Zeros * OneElement (#311)
1 parent 164ff23 commit 1a9746c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/oneelement.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function *(A::AbstractFillMatrix, x::OneElementVector)
8282
val = getindex_value(A) * getindex_value(x)
8383
Fill(val, (axes(A,1),))
8484
end
85+
*(A::AbstractZerosMatrix, x::OneElementVector) = mult_zeros(A, x)
8586

8687
function *(A::OneElementMatrix, B::AbstractFillVector)
8788
check_matmul_sizes(A, B)

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2023,6 +2023,8 @@ end
20232023
@test F * x isa Fill
20242024
@test F * x == Array(F) * Array(x)
20252025
end
2026+
2027+
@test Zeros{Int8}(2,2) * OneElement{Int16}(2,2) === Zeros{Int16}(2)
20262028
end
20272029
@testset "OneElementMatrix * AbstractFillVector" begin
20282030
@testset for ind in testinds(A)

0 commit comments

Comments
 (0)