From de0066aae5edebb69cfa8bcb2022bbb69ab11198 Mon Sep 17 00:00:00 2001 From: Alexander Konovalov Date: Fri, 7 Dec 2018 12:18:32 +0000 Subject: [PATCH] Show a warning when GroupWithGenerators called on a domain In GAP <= 4.9, the following undocumented use of GroupWithGenerators was possible: gap> GroupWithGenerators( Group( (1,2) ) ); Group([ (), (1,2) ]) This does not work in GAP 4.10.0, and #3095 restored this never documented behavior to avoid regressions in code that used to work previously. This commit adds a warning when such use of `GroupWithGenerators` is detected. --- lib/grp.gi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/grp.gi b/lib/grp.gi index 63130d00d1d..1c020db4a10 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -4401,6 +4401,12 @@ InstallMethod( GroupWithGenerators, function( gens ) local G,typ; + if IsDomain(gens) then + Info( InfoPerformance, 1, + "Calling `GroupWithGenerators' on a domain is very inefficient.\n", + "#I Use the list of generators of the domain instead."); + fi; + gens:=AsList(gens); typ:=MakeGroupyType(FamilyObj(gens), IsGroup and IsAttributeStoringRep @@ -4419,6 +4425,12 @@ InstallMethod( GroupWithGenerators, function( gens, id ) local G,typ; + if IsDomain(gens) then + Info( InfoPerformance, 1, + "Calling `GroupWithGenerators' on a domain is very inefficient.\n", + "#I Use the list of generators of the domain instead."); + fi; + gens:=AsList(gens); typ:=MakeGroupyType(FamilyObj(gens), IsGroup and IsAttributeStoringRep