Skip to content

Commit

Permalink
Restrict SetDimension method to IsFreeLeftModule (gap-system#5520)
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin authored Dec 4, 2023
1 parent adbd5b7 commit 58fa08c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
14 changes: 14 additions & 0 deletions dev/ci-download-pkgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ SRCDIR=${SRCDIR:-$PWD}

# change into BUILDDIR
[[ -n "$BUILDDIR" ]] && cd "$BUILDDIR"
BUILDDIR=$PWD

# if requested, bootstrap with minimal set of packages
if [[ $BOOTSTRAP_MINIMAL = yes ]]
Expand All @@ -29,3 +30,16 @@ fi

echo "ls $SRCDIR/pkg"
ls $SRCDIR/pkg

# reset CFLAGS, CXXFLAGS, LDFLAGS before compiling packages, to prevent
# them from being compiled with coverage gathering, because
# otherwise gcov may confuse IO's src/io.c, or anupq's src/read.c,
# with GAP kernel files with the same name
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS

# compile a few packages useful for some tests, e.g. in testbugfix
pushd "$SRCDIR/pkg"
"$SRCDIR/bin/BuildPackages.sh" --strict --with-gaproot="$BUILDDIR" io* cvec*
popd
1 change: 1 addition & 0 deletions lib/coll.gi
Original file line number Diff line number Diff line change
Expand Up @@ -3105,6 +3105,7 @@ local filt;

# some sanity checks
Assert(0, not HasIsEmpty(obj) or (IsEmpty(obj) = (sz=0)));
Assert(0, not HasIsNonTrivial(obj) or (IsNonTrivial(obj) = (sz<>1)));
Assert(0, not HasIsTrivial(obj) or (IsTrivial(obj) = (sz=1)));
Assert(0, not HasIsFinite(obj) or (IsFinite(obj) = (sz<>infinity)));

Expand Down
2 changes: 1 addition & 1 deletion lib/module.gi
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ InstallMethod( DimensionOfVectors,
# multiple immediate methods, several of which could apply and each changing
# the type of the object. Doing so can be costly and thus should be
# avoided.
InstallOtherMethod(SetDimension,true,[IsObject and IsAttributeStoringRep,IsObject],
InstallOtherMethod(SetDimension,true,[IsFreeLeftModule and IsAttributeStoringRep,IsObject],
100, # override system setter
function(obj,dim)
local filt;
Expand Down
13 changes: 13 additions & 0 deletions tst/testbugfix/2023-10-18-SetDimension.tst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# issue reported by Michel Lavrauw on 18 October 2023
gap> LoadPackage("fining",false);
true
gap> G:=ProjectivityGroup(PG(8,2));
The FinInG projectivity group PGL(9,2)
gap> H:=Group(Identity(G));
<projective collineation group with 1 generators>
gap> Size(H); # this used to run into an error
1
gap> IsTrivial(H);
true
gap> IsNonTrivial(H); # this used to return "true"
false

0 comments on commit 58fa08c

Please sign in to comment.