diff --git a/src/dispatch.jl b/src/dispatch.jl index 20f98e36..5ba9d607 100644 --- a/src/dispatch.jl +++ b/src/dispatch.jl @@ -484,13 +484,6 @@ function Base.:*(α::Number, A::LinearAlgebra.Symmetric{<:AbstractMutable}) return LinearAlgebra.Symmetric(B, c) end -function Base.:*(α::Number, A::LinearAlgebra.Hermitian{<:AbstractMutable}) - c = LinearAlgebra.sym_uplo(A.uplo) - B = c == :U ? _mult_upper(α, A) : _mult_lower(α, A) - return LinearAlgebra.Hermitian(B, c) -end - -# Fix ambiguity identified by Aqua.jl. function Base.:*(α::Real, A::LinearAlgebra.Hermitian{<:AbstractMutable}) c = LinearAlgebra.sym_uplo(A.uplo) B = c == :U ? _mult_upper(α, A) : _mult_lower(α, A) diff --git a/test/dispatch.jl b/test/dispatch.jl index 5856459c..3c8eade2 100644 --- a/test/dispatch.jl +++ b/test/dispatch.jl @@ -55,3 +55,11 @@ end @test all(MA.isequal_canonical.(2 * LinearAlgebra.Hermitian(A, :L), D)) @test all(MA.isequal_canonical.(2 * LinearAlgebra.Hermitian(A, :U), D)) end + +@testset "*(::Complex, ::Hermitian)" begin + A = BigInt[1 2; 2 3] + B = LinearAlgebra.Hermitian(DummyBigInt.(A)) + C = 2im * A + @test 2im * B == C + @test C isa Matrix{Complex{BigInt}} +end diff --git a/test/dummy.jl b/test/dummy.jl index c84e55bb..2121661c 100644 --- a/test/dummy.jl +++ b/test/dummy.jl @@ -171,3 +171,5 @@ end function Base.:^(x::DummyBigInt, y::Union{Integer,UniformScaling{<:Integer}}) return DummyBigInt(x.data^y) end + +Base.:*(x::Complex, y::DummyBigInt) = x * y.data