From 192c72a39cc8e7667fcc5fcf3f45bd1836d0a517 Mon Sep 17 00:00:00 2001 From: kalmar Date: Wed, 17 May 2017 12:30:33 +0200 Subject: [PATCH] isdefined(RG, :basis) for safety --- src/GroupRings.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GroupRings.jl b/src/GroupRings.jl index 1f35622..112260f 100644 --- a/src/GroupRings.jl +++ b/src/GroupRings.jl @@ -53,11 +53,11 @@ parent{T}(g::GroupRingElem{T}) = g.parent # ############################################################################### -function GroupRingElem{T<:Number}(c::AbstractVector{T}, A::GroupRing) - length(c) == length(A.basis) || throw("Can't create GroupRingElem -- lengths - differ: length(c) = $(length(c)) != $(length(A.basis)) = length(A.basis)") +function GroupRingElem{T<:Number}(c::AbstractVector{T}, RG::GroupRing) + isdefined(RG, :basis) || complete(RG) + length(c) == length(RG.basis) || throw("Can't create GroupRingElem -- lengths differ: length(c) = $(length(c)) != $(length(RG.basis)) = length(RG.basis)") - GroupRingElem{T}(c,A) + GroupRingElem{T}(c,RG) end convert{T<:Number}(::Type{T}, X::GroupRingElem) =