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:
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