Fix MagmaWith[One|Inverses] "no method found" errors #1798
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current master version of GAP has the following bug: (otherwise unreported, please let me know if I should have opened an issue before submitting this pull request)
The 2-argument forms of
MagmaWithOne
andMagmaWithInverses
typically do not (perhaps never) succeed as documented, but rather report "no method found" errors. See the following gap transcript for a simple example of this behavior:Checking the code in
lib/magma.gi
, the difficulty is clear: in the portions of the code for the "#family plus list of generators" alternative for the arguments to both of these functions, the first argument is correctly checked to be a family, but then the first argument, rather than the second, is checked to be a list. Since no family is a list, that branch of the code is never taken, and it falls through to the "# generators" option for the arguments, eventually failing because a family is not a sensible generator for a magma.The submitted two-character change corrects the code to check the second argument in these situations for being a list. The following log shows the transcript of the same commands executed on the corrected code; they succeed as expected: