From dbbf35c93584eb9cdd47bb352aa2fb5ee3657d75 Mon Sep 17 00:00:00 2001 From: Alex Arslan Date: Thu, 23 May 2019 16:34:25 -0700 Subject: [PATCH] Add a test for PR 32097 (#32124) This example reproduces the issue observed in issue 32092 on Julia 1.1 that was fixed by PR 32097. (cherry picked from commit 6da7aa8faf5cff49c462918a339435f4d703b999) --- stdlib/LinearAlgebra/test/matmul.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/stdlib/LinearAlgebra/test/matmul.jl b/stdlib/LinearAlgebra/test/matmul.jl index 62c7d7cc8faf2..845a0b5598169 100644 --- a/stdlib/LinearAlgebra/test/matmul.jl +++ b/stdlib/LinearAlgebra/test/matmul.jl @@ -487,4 +487,13 @@ end @test success(pipeline(cmd; stdout=stdout, stderr=stderr)) end +struct A32092 + x::Float64 +end +Base.:+(x::Float64, a::A32092) = x + a.x +Base.:*(x::Float64, a::A32092) = x * a.x +@testset "Issue #32092" begin + @test ones(2, 2) * [A32092(1.0), A32092(2.0)] == fill(3.0, (2,)) +end + end # module TestMatmul