From 8e70205060d8bb917c111300a8bc0a6560527694 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Mon, 20 Nov 2023 20:03:20 +0530 Subject: [PATCH] Disambiguate Zeros * OneElement --- src/oneelement.jl | 1 + test/runtests.jl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/oneelement.jl b/src/oneelement.jl index 099dfa32..b5804fc6 100644 --- a/src/oneelement.jl +++ b/src/oneelement.jl @@ -82,6 +82,7 @@ function *(A::AbstractFillMatrix, x::OneElementVector) val = getindex_value(A) * getindex_value(x) Fill(val, (axes(A,1),)) end +*(A::AbstractZerosMatrix, x::OneElementVector) = mult_zeros(A, x) function *(A::OneElementMatrix, B::AbstractFillVector) check_matmul_sizes(A, B) diff --git a/test/runtests.jl b/test/runtests.jl index aee883da..27970d9d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2020,6 +2020,8 @@ end @test F * x isa Fill @test F * x == Array(F) * Array(x) end + + @test Zeros{Int8}(2,2) * OneElement{Int16}(2,2) === Zeros{Int16}(2) end @testset "OneElementMatrix * AbstractFillVector" begin @testset for ind in testinds(A)