From b8779b44cc490f2f782ed99c72d668ba67a377a2 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Thu, 17 Jan 2019 08:32:09 +0100 Subject: [PATCH] scalar*Vector needs .* on julia-1.0 --- src/GroupRings.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index d8970c9..90a4743 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -297,12 +297,13 @@ end mul(a::T, X::GroupRingElem{T}) where {T<:Number} = GroupRingElem(a*X.coeffs, parent(X)) function mul(a::T, X::GroupRingElem{S}) where {T<:Number, S<:Number} - promote_type(T,S) == S || @warn("Scalar and coeffs are in different rings! Promoting result to $(promote_type(T,S))") - return GroupRingElem(a*X.coeffs, parent(X)) + TT = promote_type(T,S) + TT == S || @warn("Scalar and coeffs are in different rings! Promoting result to $(TT)") + return GroupRingElem(a.*X.coeffs, parent(X)) end -(*)(a, X::GroupRingElem) = mul(a,X) -(*)(X::GroupRingElem, a) = mul(a,X) +(*)(a::Number, X::GroupRingElem) = mul(a,X) +(*)(X::GroupRingElem, a::Number) = mul(a,X) # disallow Rings to hijack *(::, ::GroupRingElem) *(a::Union{AbstractFloat, Integer, RingElem, Rational}, X::GroupRingElem) = mul(a,X)