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
UNIVERSAL::can is wrong for unloaded classes #9098
Comments
From @btillyCreated by btilly@gmail.com unless (Foo->can("can")) { As the code snippet above demonstrates, if the package Foo is In case anyone wonders whether the ability to call can is a sub UNIVERSAL::bar { Foo->bar(); # Prints After the line "package Foo;" has been read, though, can will This behaviour came up in use warnings; # This warns that we're calling can as a function. I've also submitted a patch to chromatic that would get rid of Cheers, Perl Info
|
From @doyI've pushed a fix for this to the doy/universal branch. It's pretty |
From [Unknown Contact. See original ticket]I've pushed a fix for this to the doy/universal branch. It's pretty |
@doy - Status changed from 'new' to 'open' |
From @cpansproutOn Fri Jun 22 12:14:55 2012, doy wrote:
I think $class->can('can') is a fairly popular way to see whether a -- Father Chrysostomos |
From @doyOn Fri, Jun 22, 2012 at 12:35:32PM -0700, Father Chrysostomos via RT wrote:
But (as mst pointed out on #p5p) it doesn't do that at all: $ perl -E'package Foo::Bar; say Foo->can("can")' (since namespaces nest). And having $foo->can("can") not die and yet not -doy |
From @cpansproutOn Fri Jun 22 12:50:38 2012, doy@tozt.net wrote:
Fairy nuff. :-) -- Father Chrysostomos |
From @rjbs* Jesse Luehrs via RT <perlbug-comment@perl.org> [2012-06-22T15:14:56]
It seems to bring ->can closer to reflecting reality, which sounds good. -- |
From [Unknown Contact. See original ticket]Fixed by 68b4061. |
@doy - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#47113 (status was 'resolved')
Searchable as RT47113$
The text was updated successfully, but these errors were encountered: