Skip to content

Commit 0a816e8

Browse files
fix: fix Arr multiplication ambiguity
1 parent 874a572 commit 0a816e8

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/array-lib.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ const PolyadicT = Union{AbstractArray{<:Number}, Number}
7474
function *(x::Arr, args::PolyadicT...)
7575
return *(unwrap(x), args...)
7676
end
77-
77+
function *(x::Arr, y::Number, args::PolyadicT...)
78+
return *(unwrap(x), unwrap(y), args...)
79+
end
7880
function *(a::PolyadicT, b::Arr, bs::PolyadicT...)
7981
return *(a, unwrap(b), bs...)
8082
end

test/arrays.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -445,3 +445,8 @@ end
445445
@test isequal(SymbolicUtils.sorted_arguments(sym), [unwrap(x), unwrap(y)])
446446
@test operation(sym) === +
447447
end
448+
449+
@testset "matmul ambiguity" begin
450+
@variables x[1:3] y
451+
@test_nowarn x * y
452+
end

0 commit comments

Comments
 (0)