Skip to content

Commit

Permalink
Show a warning when GroupWithGenerators called on a domain
Browse files Browse the repository at this point in the history
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 gap-system#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.
  • Loading branch information
Alexander Konovalov committed Dec 7, 2018
1 parent 72d2c36 commit 7195610
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7195610

Please sign in to comment.