mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-10-08 22:25:34 +02:00
safer coercion of GroupRingElem to GroupRing
This commit is contained in:
parent
0972cd1fdc
commit
7ba59d6508
@ -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
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user