From 1a9746c81bbc637e20e697422ac1a037ea6904c7 Mon Sep 17 00:00:00 2001 From: Jishnu Bhattacharya Date: Sat, 2 Dec 2023 19:23:39 +0530 Subject: [PATCH] Disambiguate Zeros * OneElement (#311) --- 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 f0ff01ee..56fe53be 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2023,6 +2023,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)