diff --git a/lib/grp.gi b/lib/grp.gi index 773c4f9319b..63130d00d1d 100644 --- a/lib/grp.gi +++ b/lib/grp.gi @@ -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 ); @@ -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; diff --git a/tst/testbugfix/2018-12-06-GroupWithGenerators.tst b/tst/testbugfix/2018-12-06-GroupWithGenerators.tst new file mode 100644 index 00000000000..51ecce4d6f2 --- /dev/null +++ b/tst/testbugfix/2018-12-06-GroupWithGenerators.tst @@ -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) ])