| Store | Cart

[perl #132902] Blead Breaks CPAN: Class::Std

From: Father Chrysostomos via RT <perl...@perl.org>
Sat, 24 Feb 2018 10:01:14 -0800
On Sat, 24 Feb 2018 04:16:48 -0800, demerphq wrote:
> On 24 February 2018 at 12:32, demerphq <deme...@gmail.com> wrote:> > On 24 February 2018 at 03:46, demerphq <deme...@gmail.com> wrote:> >> On 24 February 2018 at 03:44, Zefram <zef...@fysh.org> wrote:> >>> demerphq wrote:> >>>> Thanks, this looks like fallout from a fix I pushed yesterday.> >>>> >>> Confirmed: it bisects to commit> >>> c99363aa273278adcad39f32026629b700f9bbc3> >>> "fix Perl #132828 - dont use overload to bypass overloads".  The> >>> relevant> >>> part of Class::Std is overriding UNIVERSAL::can.> >>> >> Which means its Class::Std's fault for not implementing can> >> properly.> >>> >> Nevertheless I will find a fix.> >>> >> Thanks for verifying and the analysis Zefram.> >> > I have created a pull request against Class::Std to fix this.> >> > https://github.com/chorny/Class-Std/pull/2> >> > I also will push a patch to fix this in Carp.pm as well.> > Fixed in 17157c41e6523264e0f5e7d4baa490a1a8f2322b

I don’t like the current state of the code in Carp.pm, but I can’t say I have a better suggestion off the top of my head.  I have not thought it through thoroughly yet.  Let me just outline my concerns, before I forget them, and later if I have time I might come up with a patch:

if ($in_recurse || do{ local $in_recurse = 1; $pack->can("((") }) {

This will only work on newer perls (5.16+ iirc), since older ones used (), not ((.  And I think even current perl allows XS modules to register overloading via just (), without ((.  I need to check.

‘can’ is really not the right thing to use.  Overriding ‘can’ makes sense in the presence of AUTOLOAD, but since overloading bypassing AUTOLOAD, it should be bypassing ‘can‘ as well.  This is why overload.pm implements its own ‘can’.  Perhaps overload.pm should be loaded unconditionally when Carp is loaded (it is more lightweight than Carp, after all).  Then theoretically one could use overload::Overloaded, but unfortunately old versions have the same ‘can’ bug that will cause the recursion.  Maybe calling overload::mycan directly is the solution.

This is a real can of worms.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=132902

Recent Messages in this Thread
Father Chrysostomos via RT Feb 28, 2018 05:41 am
bulk88 via RT Mar 01, 2018 08:47 am
Father Chrysostomos via RT Feb 28, 2018 06:09 pm
Father Chrysostomos via RT Feb 26, 2018 07:50 am
Father Chrysostomos via RT Feb 27, 2018 05:12 pm
Father Chrysostomos via RT Feb 26, 2018 07:57 am
Father Chrysostomos via RT Feb 26, 2018 09:33 am
Father Chrysostomos via RT Feb 27, 2018 05:16 pm
bulk88 via RT Feb 28, 2018 04:04 am
bulk88 via RT Feb 28, 2018 04:21 am
Father Chrysostomos via RT Feb 26, 2018 02:21 am
Father Chrysostomos via RT Feb 25, 2018 01:40 am
Father Chrysostomos via RT Feb 25, 2018 06:24 am
Father Chrysostomos via RT Feb 25, 2018 08:28 pm
Father Chrysostomos via RT Feb 26, 2018 04:02 am
Father Chrysostomos via RT Feb 25, 2018 06:48 pm
Father Chrysostomos via RT Feb 26, 2018 02:22 am
Carlos Guevara (via RT) Feb 24, 2018 01:45 am
Zefram Feb 24, 2018 02:44 am
Father Chrysostomos via RT Feb 24, 2018 06:01 pm
Father Chrysostomos via RT Feb 26, 2018 02:25 am
Messages in this thread