Skip to content

Commit

Permalink
Fix TypeOfOperation for setters of and-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Mar 23, 2018
1 parent ac64e83 commit c9ef811
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 4 additions & 0 deletions lib/type.gi
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ function(oper)
type := "Representation";
fi;
fi;
elif IsOperation(FLAG1_FILTER(oper)) and IsOperation(FLAG1_FILTER(oper)) then
# this is a setter for an and-filter
type := "Setter";
elif FLAG1_FILTER(oper) > 0 then
# this is a setter for an elementary filter
type := "Setter";
elif Tester(oper) <> false then
# oper is an attribute
Expand Down
20 changes: 17 additions & 3 deletions tst/testinstall/type.tst
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,36 @@ true
gap> TypeOfOperation(IsFilter);
Error, <oper> must be an operation

#
# elementary filters: property
gap> TypeOfOperation(IsAbelian);
"Property"
gap> TypeOfOperation(HasIsAbelian);
"Filter"
gap> TypeOfOperation(SetIsAbelian);
"Setter"

# and-filters
gap> TypeOfOperation(IsPGroup and IsAbelian);
"Property"
gap> TypeOfOperation(HasIsPGroup and HasIsAbelian);
"Filter"
gap> TypeOfOperation(Tester(IsPGroup and IsAbelian));
"Filter"
gap> TypeOfOperation(Setter(IsPGroup and IsAbelian));
"Setter"

# kernel category
gap> TypeOfOperation(IsMutable);
"Category"
gap> TypeOfOperation(Setter(IsMutable));
"Setter"

# other
gap> TypeOfOperation(\+);
"Operation"
gap> TypeOfOperation(Size);
"Attribute"
gap> TypeOfOperation(AbelianGroupCons);
"Constructor"
gap> TypeOfOperation(Setter(IS_MUTABLE_OBJ));
"Setter"

#

0 comments on commit c9ef811

Please sign in to comment.