1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-09-05 06:45:40 +02:00

safer coercion of GroupRingElem to GroupRing

This commit is contained in:
kalmar 2017-06-05 21:36:31 +02:00
parent 0972cd1fdc
commit 7ba59d6508

View File

@ -131,7 +131,10 @@ function (RG::GroupRing)(x::AbstractVector)
return result
end
(RG::GroupRing)(X::GroupRingElem) = RG(X.coeffs)
function (RG::GroupRing)(X::GroupRingElem)
RG == parent(X) || throw("Can not coerce!")
return RG(X.coeffs)
end
###############################################################################
#