Skip to content

Commit

Permalink
Change GroupWithGenerators to accept collections again
Browse files Browse the repository at this point in the history
In GAP <= 4.9, this worked:

    gap> GroupWithGenerators( Group( (1,2) ) );
    Group([ (), (1,2) ])

In GAP 4.10, this was broken and instead lead to a "method not found" error.
While strictly speaking this was never documented behavior, we restore it
to avoid regressions in code that relied on this undocumented behavior.

Resolves gap-system#2703
  • Loading branch information
fingolfin committed Dec 6, 2018
1 parent 8a9aa64 commit d42fa06
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/grp.gi
Original file line number Diff line number Diff line change
Expand Up @@ -4401,13 +4401,14 @@ InstallMethod( GroupWithGenerators,
function( gens )
local G,typ;

gens:=AsList(gens);
typ:=MakeGroupyType(FamilyObj(gens),
IsGroup and IsAttributeStoringRep
and HasIsEmpty and HasGeneratorsOfMagmaWithInverses,
gens,false,true);

G:=rec();
ObjectifyWithAttributes(G,typ,GeneratorsOfMagmaWithInverses,AsList(gens));
ObjectifyWithAttributes(G,typ,GeneratorsOfMagmaWithInverses,gens);

return G;
end );
Expand All @@ -4418,13 +4419,14 @@ InstallMethod( GroupWithGenerators,
function( gens, id )
local G,typ;

gens:=AsList(gens);
typ:=MakeGroupyType(FamilyObj(gens),
IsGroup and IsAttributeStoringRep
and HasIsEmpty and HasGeneratorsOfMagmaWithInverses and HasOne,
gens,id,true);

G:=rec();
ObjectifyWithAttributes(G,typ,GeneratorsOfMagmaWithInverses,AsList(gens),
ObjectifyWithAttributes(G,typ,GeneratorsOfMagmaWithInverses,gens,
One,id);

return G;
Expand Down
5 changes: 5 additions & 0 deletions tst/testbugfix/2018-12-06-GroupWithGenerators.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# These are undocumented, but should still work
gap> GroupByGenerators( Group( (1,2) ) );
Group([ (), (1,2) ])
gap> GroupWithGenerators( Group( (1,2) ) );
Group([ (), (1,2) ])

0 comments on commit d42fa06

Please sign in to comment.