Skip to content

Commit cf965f3

Browse files
fredrikekregiordano
authored andcommitted
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. (cherry picked from commit f5937b4)
1 parent 4877204 commit cf965f3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/LinearAlgebra/test/matmul.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,8 +1116,8 @@ end
11161116
Base.zero(::Thing) = Thing(0.)
11171117
Base.one(::Type{Thing}) = Thing(1.)
11181118
Base.one(::Thing) = Thing(1.)
1119-
Base.:+(t::Thing...) = +(getfield.(t, :data)...)
1120-
Base.:*(t::Thing...) = *(getfield.(t, :data)...)
1119+
Base.:+(t1::Thing, t::Thing...) = +(getfield.((t1, t...), :data)...)
1120+
Base.:*(t1::Thing, t::Thing...) = *(getfield.((t1, t...), :data)...)
11211121

11221122
M = Float64[1 2; 3 4]
11231123
A = Thing.(M)

0 commit comments

Comments
 (0)