Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id: 102487
Status: rejected
Priority: 0/
Queue: Moo

People
Owner: Nobody in particular
Requestors: sven.schober [...] uni-ulm.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Prototype mismatch with role composition and around
Date: Tue, 03 Mar 2015 14:07:24 +0100
To: bug-Moo [...] rt.cpan.org
From: Sven Schober <sven.schober [...] uni-ulm.de>
Executing the attached minimal example yields: $ perl prototype-mismatch.pl Prototype mismatch: sub cG::mA ($) vs none at (eval 18) line 2. ok 1 - correct wrapping 1..1 So, the prototype seems not to be preserved during application of the role. Is this expected behaviour, or is there a way around this? Note, this only occurs with role composition and not with inheritance. I am using Perl 5.18.2, Moo and Moo::Role 2.000000. Cheers Sven -- Dipl.-Inf. Sven Schober Universität Ulm kiz - Abteilung Infrastruktur 89069 Ulm Tel.: +49 731 50 22484

Message body is not shown because sender requested not to inline it.

Download smime.p7s
application/pkcs7-signature 4.6k

Message body not shown because it is not plain text.

I can't reproduce this problem. What version of Class::Method::Modifiers do you have?
Subject: Re: [rt.cpan.org #102487] Prototype mismatch with role composition and around
Date: Tue, 03 Mar 2015 16:15:49 +0100
To: bug-Moo [...] rt.cpan.org
From: Sven Schober <sven.schober [...] uni-ulm.de>
On 03.03.2015 14:26, Graham Knop via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102487 > > > I can't reproduce this problem. What version of Class::Method::Modifiers do you have? >
Class::Method::Modifiers: 2.04 Do you need anything else?
Download smime.p7s
application/pkcs7-signature 4.6k

Message body not shown because it is not plain text.

I looked at this again after some coffee and it looks like the script you posted doesn't correspond to what you were running to generate the output. Class::Method::Modifiers doesn't preserve prototypes in its wrapped subs because for one, methods completely ignore prototypes. There's no real sensible way for them to be preserved, using either the existing sub or the modifier sub. In your test script, the prototypes serve no purpose. I don't think this is a feature we will want to include.
Subject: Re: [rt.cpan.org #102487] Prototype mismatch with role composition and around
Date: Tue, 03 Mar 2015 17:03:44 +0100
To: bug-Moo [...] rt.cpan.org
From: Sven Schober <sven.schober [...] uni-ulm.de>
On 03.03.2015 16:45, Graham Knop via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=102487 > > > I looked at this again after some coffee and it looks like the > script you posted doesn't correspond to what you were running to > generate the output. >
Yes, I am sorry to have given you headaches! The script I attached was a later (more complicated) version. For completeness sake, I've attachted a slightly less complicated sample really exibiting the "problem" to this mail. Show quoted text
> Class::Method::Modifiers doesn't preserve prototypes in its wrapped > subs because for one, methods completely ignore prototypes.
Ok, I did not know that. Is this documented somewhere, so I'd know where to look next time? Show quoted text
> There's no real sensible way for them to be preserved, using either > the existing sub or the modifier sub. >
Ok, then the whole point of this issue is nill. *g* Show quoted text
> In your test script, the prototypes serve no purpose. I don't think > this is a feature we will want to include. >
Yes, that's right, not in this little script.

Message body is not shown because sender requested not to inline it.

Download smime.p7s
application/pkcs7-signature 4.6k

Message body not shown because it is not plain text.

On Tue Mar 03 11:03:58 2015, sven.schober@uni-ulm.de wrote: Show quoted text
> On 03.03.2015 16:45, Graham Knop via RT wrote:
> > Class::Method::Modifiers doesn't preserve prototypes in its wrapped > > subs because for one, methods completely ignore prototypes.
> > Ok, I did not know that. Is this documented somewhere, so I'd know where > to look next time?
The Prototypes section in perlsub covers this. http://perldoc.perl.org/perlsub.html#Prototypes