You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a bug report for perl from [email protected],
generated with the help of perlbug 1.43 running under perl 5.39.2.
Description
If the class A::B inherits A with 'class A::B :isa(A)', A.pm does not
get loaded/required. This seems to be because of the hierarchical naming:
class B :isa(A) loads A.pm just fine.
I don't see a mention of this in the documentation, and Object::Pad
does not exhibit the same behaviour FWIW.
Explicitly loading A first (with e.g. 'use A') seems to be a workaround.
Steps to Reproduce
% cat lib/A.pm
use feature 'class';
class A {};
1;
% cat lib/A/B.pm
use feature 'class';
class A::B :isa(A) {};
1;
% perl -Ilib -c lib/A/B.pm; echo $?
class is experimental at lib/A/B.pm line 2.
Class :isa attribute requires a class but "A" is not one at lib/A/B.pm line 2.
255
Expected behavior
A.pm should get loaded as described in perlclass.pod for :isa().
If class Foo::Bar exists then the Foo stash exists, so checking
for that when Foo is the requested base class is meaningless.
Instead try to load the base class if it is not known as a class, not
just if it's not a stash, just as we do immediately following.
FixesPerl#21332
If class Foo::Bar exists then the Foo stash exists, so checking
for that when Foo is the requested base class is meaningless.
Instead try to load the base class if it is not known as a class, not
just if it's not a stash, just as we do immediately following.
Fixes#21332
sir-xw
pushed a commit
to openkylin/libstring-license-perl
that referenced
this issue
Apr 18, 2025
This is a bug report for perl from [email protected],
generated with the help of perlbug 1.43 running under perl 5.39.2.
Description
If the class A::B inherits A with 'class A::B :isa(A)', A.pm does not
get loaded/required. This seems to be because of the hierarchical naming:
class B :isa(A) loads A.pm just fine.
I don't see a mention of this in the documentation, and Object::Pad
does not exhibit the same behaviour FWIW.
Explicitly loading A first (with e.g. 'use A') seems to be a workaround.
Steps to Reproduce
% cat lib/A.pm
use feature 'class';
class A {};
1;
% cat lib/A/B.pm
use feature 'class';
class A::B :isa(A) {};
1;
% perl -Ilib -c lib/A/B.pm; echo $?
class is experimental at lib/A/B.pm line 2.
Class :isa attribute requires a class but "A" is not one at lib/A/B.pm line 2.
255
Expected behavior
A.pm should get loaded as described in perlclass.pod for :isa().
Flags
Perl configuration
The text was updated successfully, but these errors were encountered: