From f5937b432c51f6b8a5b28eaa5c1583f1350e12a3 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 16 Oct 2024 13:46:22 +0200 Subject: [PATCH] Remove zero arg methods of `+` and `*` from linalg tests (#56184) There are tests elsewhere that i) make sure there is no zero-arg methods of these functions and ii) tests that e.g. `+()` throws a `MethodError`. Without this patch there are test errors whenever the same test process runs both of these tests. --- stdlib/LinearAlgebra/test/matmul.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/LinearAlgebra/test/matmul.jl b/stdlib/LinearAlgebra/test/matmul.jl index 0d1e2776d2bb3..1294e97c2a30c 100644 --- a/stdlib/LinearAlgebra/test/matmul.jl +++ b/stdlib/LinearAlgebra/test/matmul.jl @@ -1139,8 +1139,8 @@ end Base.zero(::Thing) = Thing(0.) Base.one(::Type{Thing}) = Thing(1.) Base.one(::Thing) = Thing(1.) - Base.:+(t::Thing...) = +(getfield.(t, :data)...) - Base.:*(t::Thing...) = *(getfield.(t, :data)...) + Base.:+(t1::Thing, t::Thing...) = +(getfield.((t1, t...), :data)...) + Base.:*(t1::Thing, t::Thing...) = *(getfield.((t1, t...), :data)...) M = Float64[1 2; 3 4] A = Thing.(M)