Skip to content

Commit

Permalink
Fix IsSpecializationOfFilter for strings defining tuples
Browse files Browse the repository at this point in the history
CAP_INTERNAL_REPLACED_STRING_WITH_FILTER turns IsNTuple into
IsDenseList, which we do not want at this point.
  • Loading branch information
zickgraf committed Sep 25, 2023
1 parent d47e5fe commit 6b40dd5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 7 deletions.
2 changes: 1 addition & 1 deletion CAP/PackageInfo.g
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ SetPackageInfo( rec(

PackageName := "CAP",
Subtitle := "Categories, Algorithms, Programming",
Version := "2023.09-07",
Version := "2023.09-08",
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
License := "GPL-2.0-or-later",

Expand Down
33 changes: 27 additions & 6 deletions CAP/gap/ToolsForCategories.gi
Original file line number Diff line number Diff line change
Expand Up @@ -889,21 +889,42 @@ InstallGlobalFunction( InstallDeprecatedAlias,
end );

##
InstallGlobalFunction( "IsSpecializationOfFilter", function ( filter1, filter2 )
InstallGlobalFunction( "IsSpecializationOfFilter", function ( filter_1, filter_2 )
local data_type_1, data_type_2;

if IsString( filter1 ) then
if IsString( filter_1 ) then

filter1 := CAP_INTERNAL_REPLACED_STRING_WITH_FILTER( filter1 );
data_type_1 := CAP_INTERNAL_GET_DATA_TYPE_FROM_STRING( filter_1 );

if data_type_1 = fail then

filter_1 := IsObject;

Check warning on line 901 in CAP/gap/ToolsForCategories.gi

View check run for this annotation

Codecov / codecov/patch

CAP/gap/ToolsForCategories.gi#L901

Added line #L901 was not covered by tests

else

filter_1 := data_type_1.filter;

fi;

fi;

if IsString( filter2 ) then
if IsString( filter_2 ) then

filter2 := CAP_INTERNAL_REPLACED_STRING_WITH_FILTER( filter2 );
data_type_2 := CAP_INTERNAL_GET_DATA_TYPE_FROM_STRING( filter_2 );

if data_type_2 = fail then

filter_2 := IsObject;

Check warning on line 917 in CAP/gap/ToolsForCategories.gi

View check run for this annotation

Codecov / codecov/patch

CAP/gap/ToolsForCategories.gi#L917

Added line #L917 was not covered by tests

else

filter_2 := data_type_2.filter;

fi;

fi;

return IS_SUBSET_FLAGS( WITH_IMPS_FLAGS( FLAGS_FILTER( filter2 ) ), WITH_IMPS_FLAGS( FLAGS_FILTER( filter1 ) ) );
return IS_SUBSET_FLAGS( WITH_IMPS_FLAGS( FLAGS_FILTER( filter_2 ) ), WITH_IMPS_FLAGS( FLAGS_FILTER( filter_1 ) ) );

end );

Expand Down

0 comments on commit 6b40dd5

Please sign in to comment.