-
Notifications
You must be signed in to change notification settings - Fork 561
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
Use of inherited AUTOLOAD for non-method is deprecated #9094
Comments
From [email protected]This warning sometimes comes up for real methods. Attached is a patch lib/warnings..................................................PROG: -- |
From [email protected]autoload.patchdiff -pruN perl-current/pp_hot.c perl-current-dev/pp_hot.c
--- perl-current/pp_hot.c 2007-10-22 11:44:08.000000000 -0400
+++ perl-current-dev/pp_hot.c 2007-10-30 22:34:01.000000000 -0400
@@ -2717,9 +2717,14 @@ PP(pp_entersub)
}
/* should call AUTOLOAD now? */
else {
-try_autoload:
+try_autoload:
+ {
+ const bool is_method = cLISTOP->op_last &&
+ (cLISTOP->op_last->op_type == OP_METHOD_NAMED ||
+ cLISTOP->op_last->op_type == OP_METHOD);
+
if ((autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv),
- FALSE)))
+ is_method)))
{
cv = GvCV(autogv);
}
@@ -2729,6 +2734,7 @@ try_autoload:
gv_efullname3(sub_name, gv, NULL);
DIE(aTHX_ "Undefined subroutine &%"SVf" called", SVfARG(sub_name));
}
+ }
}
if (!cv)
DIE(aTHX_ "Not a CODE reference");
diff -pruN perl-current/t/lib/warnings/gv perl-current-dev/t/lib/warnings/gv
--- perl-current/t/lib/warnings/gv 2007-07-11 15:34:23.000000000 -0400
+++ perl-current-dev/t/lib/warnings/gv 2007-10-30 17:08:14.000000000 -0400
@@ -39,6 +39,8 @@ sub Other::AUTOLOAD { 1 } sub Other::fre
@ISA = qw(Other) ;
use warnings 'deprecated' ;
fred() ;
+my $x = \&barney;
+(bless[])->barney;
EXPECT
Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5.
########
|
From [email protected]Ping. On Oct 30 2007, Rick Delaney wrote:
The patch sent with the original message still applies cleanly. -- |
From [email protected]autoload.patchdiff -pruN perl-current/pp_hot.c perl-current-dev/pp_hot.c
--- perl-current/pp_hot.c 2007-10-22 11:44:08.000000000 -0400
+++ perl-current-dev/pp_hot.c 2007-10-30 22:34:01.000000000 -0400
@@ -2717,9 +2717,14 @@ PP(pp_entersub)
}
/* should call AUTOLOAD now? */
else {
-try_autoload:
+try_autoload:
+ {
+ const bool is_method = cLISTOP->op_last &&
+ (cLISTOP->op_last->op_type == OP_METHOD_NAMED ||
+ cLISTOP->op_last->op_type == OP_METHOD);
+
if ((autogv = gv_autoload4(GvSTASH(gv), GvNAME(gv), GvNAMELEN(gv),
- FALSE)))
+ is_method)))
{
cv = GvCV(autogv);
}
@@ -2729,6 +2734,7 @@ try_autoload:
gv_efullname3(sub_name, gv, NULL);
DIE(aTHX_ "Undefined subroutine &%"SVf" called", SVfARG(sub_name));
}
+ }
}
if (!cv)
DIE(aTHX_ "Not a CODE reference");
diff -pruN perl-current/t/lib/warnings/gv perl-current-dev/t/lib/warnings/gv
--- perl-current/t/lib/warnings/gv 2007-07-11 15:34:23.000000000 -0400
+++ perl-current-dev/t/lib/warnings/gv 2007-10-30 17:08:14.000000000 -0400
@@ -39,6 +39,8 @@ sub Other::AUTOLOAD { 1 } sub Other::fre
@ISA = qw(Other) ;
use warnings 'deprecated' ;
fred() ;
+my $x = \&barney;
+(bless[])->barney;
EXPECT
Use of inherited AUTOLOAD for non-method main::fred() is deprecated at - line 5.
########
|
@smpeters - Status changed from 'new' to 'resolved' |
From @smpetersSorry, this must have been lost in the freeze. This patch was added Thanks! Steve Peters On Feb 12, 2008 12:50 PM, Rick Delaney <rick@bort.ca> wrote:
|
From @rgsOn 13/02/2008, Steve Peters <steve@fisharerojo.org> wrote:
And removed with change #33307. OP_ENTERSUB, as an UNOP, doesn't have The correct way to get the last child is to navigate all the way |
From [email protected]On Feb 14 2008, Rafael Garcia-Suarez wrote:
Oops, I always thought it was a LISTOP.
Probably not. -- |
@cpansprout - Status changed from 'resolved' to 'open' |
From @cpansproutOn Thu Feb 14 06:42:54 2008, rafael wrote:
I have reapplied Rick Delaney’s test in commit 9493dad and fixed the bug another way in 1de22db. -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#47047 (status was 'resolved')
Searchable as RT47047$
The text was updated successfully, but these errors were encountered: