preserve type of coerced element

This commit is contained in:
kalmar 2017-07-12 20:54:20 +02:00
parent ee3b4e0761
commit fc3cbeb14c
1 changed files with 7 additions and 5 deletions

View File

@ -151,11 +151,13 @@ function (RG::GroupRing)(X::GroupRingElem)
end
function (RG::GroupRing)(X::GroupRingElem, emb::Function)
result = RG(eltype(X.coeffs))
for g in parent(X).basis
result[emb(g)] = X[g]
end
return result
result = RG(eltype(X.coeffs))
T = typeof(X.coeffs)
result.coeffs = T(result.coeffs)
for g in parent(X).basis
result[emb(g)] = X[g]
end
return result
end
###############################################################################