Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recursive inheritance of classes #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

albert-github
Copy link
Collaborator

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.

The source code of the file where the problem occurred and its translation by the filter: transform.tar.gz
Original repository: https://github.com/PDLPorters/pdl
Found by Fossies

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant