From cde02cb6321da2a96cf660ac62efe274fd02b8d6 Mon Sep 17 00:00:00 2001 From: albert-github Date: Sat, 29 Oct 2022 13:20:07 +0200 Subject: [PATCH] Recursive inheritance of classes When there is something like: ``` package PDL::Transform; our @EXPORT_OK = qw(apply invert map map unmap t_inverse t_compose t_wrap t_identity t_lookup t_linear t_scale t_offset t_rot t_fits t_code t_cylindrical t_radial t_quadratic t_cubic t_quadratic t_spherical t_projective ); our %EXPORT_TAGS = (Func=>\@EXPORT_OK); use PDL::Core; use PDL::Exporter; use DynaLoader; our @ISA = ( 'PDL::Exporter','DynaLoader' ); push @PDL::Core::PP, __PACKAGE__; bootstrap PDL::Transform ; ``` in the code and later on: ``` .... { package PDL::Transform::Linear; our @ISA = ('PDL::Transform'); *_opt = \&PDL::Transform::_opt; ... ``` this results in the line: ``` namespace PDL { class Transform: public ::PDL::Exporter, public ::DynaLoader, public ::PDL::Transform { ``` i.e. recursive inheritance, which has now been excluded by means of the `if` clause. Note: the meaning of the `{` here is not clean whether this is some sort of innerclass (in Cpp terms) and might have to be handled differently. The pach just removes the problem. --- lib/Doxygen/Filter/Perl.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Doxygen/Filter/Perl.pm b/lib/Doxygen/Filter/Perl.pm index d887c4e..afab7e4 100644 --- a/lib/Doxygen/Filter/Perl.pm +++ b/lib/Doxygen/Filter/Perl.pm @@ -667,7 +667,10 @@ sub _PrintClassBlock { if (defined($inherit)) { - print(($count++ == 0 ? ": " : ", ")." public ::".$inherit); + if ($sFullClass ne $inherit) + { + print(($count++ == 0 ? ": " : ", ")." public ::".$inherit); + } } }