Skip Menu |

This queue is for tickets about the true CPAN distribution.

Report information
The Basics
Id: 124745
Status: resolved
Priority: 0/
Queue: true

People
Owner: CHOCOLATE [...] cpan.org
Requestors: Smylers [...] stripey.com
Cc:
AdminCc:

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



Subject: Doesn't work when used on a Moo role with Function::Parameters
true doesn't work when used on a Moo role that defines methods using Function::Parameters when the module is loaded at role composition time. Specifically: $ perl -MMoo -E 'with q[RoleWithMethod]' RoleWithMethod.pm did not return a true value at /usr/local/share/perl/5.18.2/Module/Runtime.pm line 314. for the attached RoleWithMethod.pm. This may be a bug in Function::Parameters (it doesn't happen if the method is defined using Perl's built-in sub keyword, rather than method from Function::Parameters), so I've opened cpan:#124743 to check that side of things. Or it may be bug in Moo, since this happens when applying a Moo role, for which I've opened cpan:#124744. But since the actual symptom is the true module's functionality missing, I've opened this here too. Cheers Smylers
Subject: RoleWithMethod.pm
package RoleWithMethod; use Moo::Role; use true; use Function::Parameters; method blah() {}
Hi, Smylers. Thanks for reporting this. I can't reproduce it with perl v5.26.1 (Linux), true 0.18, Moo 2.003004, Function::Parameters 2.001003 and Devel::StackTrace (which true uses) 2.03. I'm running: $ perl -I. -MMoo -E 'with q[RoleWithMethod]' Is there anything else I need? Note: as a quick debugging technique, you can comment out the warnings in true.pm to see what files it thinks are enabling (or disabling) it i.e. these lines: * https://github.com/chocolateboy/true/blob/0.18/lib/true.pm#L51 * https://github.com/chocolateboy/true/blob/0.18/lib/true.pm#L60
On Fri Mar 30 17:53:17 2018, CHOCOLATE wrote: Show quoted text
> I can't reproduce it with perl v5.26.1 (Linux),
Hi. Thanks for your response. Sorry, I forgot to check Perl version before reporting this. It turns out that this no longer fails on Perl v5.24 and newer, according to this comment: https://rt.cpan.org/Ticket/Display.html?id=124744#txn-1775958 I think I've had the failure on both Windows and Linux, and it was using the latest versions of true, Function::Parameters, and Moo at the point I reported this (not sure about Devel::StackTrace). Show quoted text
> Note: as a quick debugging technique, you can comment out the warnings > in true.pm to see what files it thinks are enabling (or disabling) it
Thanks. I shall give that a go and let you know once I'm back after Easter. Cheers Smylers
On Fri Mar 30 18:10:42 2018, Smylers@stripey.com wrote: Show quoted text
> I think ... it was using the latest versions of true, > Function::Parameters, and Moo at the point I reported this (not sure > about Devel::StackTrace).
I have checked, and still get the problem with perl v5.22 and the module versions you list above. Show quoted text
> > Note: as a quick debugging technique, you can comment out the > > warnings in true.pm to see what files it thinks are enabling (or > > disabling) it
> > Thanks. I shall give that a go and let you know once I'm back after > Easter.
Ooops. So sorry for forgetting about this. Here's the output with both of those warn lines uncommented: $ perl -I. -MMoo -E 'with q[RoleWithMethod]' true: enabling true for RoleWithMethod.pm at /usr/share/perl5/Module/Runtime.pm line 317 RoleWithMethod.pm did not return a true value at /usr/share/perl5/Module/Runtime.pm line 317. Does that help? Smylers
Sorry for the late response. This should be fixed in true v1.0.0, which I've just released. [1] I couldn't figure out why this error occurs with this combination of modules in perl < 5.24, but I don't want to drop support for old perls just yet, so I've implemented a workaround (force a true return value for modules which use true even if they return true already) which solves the problem, but it's a hack since I don't know *why* it's needed in this case. Either way, it's disabled/isn't needed on perl >= 5.24, so I won't feel bad about it forever :-) I've moved issue reporting to GitHub, so please let me know there if you spot any issues. [2] Thanks again, chocolateboy. [1] https://metacpan.org/release/CHOCOLATE/true-v1.0.0 [2] https://github.com/chocolateboy/true/issues On Thu Jul 26 06:59:34 2018, Smylers@stripey.com wrote: Show quoted text
> On Fri Mar 30 18:10:42 2018, Smylers@stripey.com wrote: >
> > I think ... it was using the latest versions of true, > > Function::Parameters, and Moo at the point I reported this (not sure > > about Devel::StackTrace).
> > I have checked, and still get the problem with perl v5.22 and the > module > versions you list above. >
> > > Note: as a quick debugging technique, you can comment out the > > > warnings in true.pm to see what files it thinks are enabling (or > > > disabling) it
> > > > Thanks. I shall give that a go and let you know once I'm back after > > Easter.
> > Ooops. So sorry for forgetting about this. Here's the output with both > of those warn lines uncommented: > > $ perl -I. -MMoo -E 'with q[RoleWithMethod]' > true: enabling true for RoleWithMethod.pm at > /usr/share/perl5/Module/Runtime.pm line 317 > RoleWithMethod.pm did not return a true value at > /usr/share/perl5/Module/Runtime.pm line 317. > > Does that help? > > Smylers