Skip Menu |

This queue is for tickets about the Function-Parameters CPAN distribution.

Report information
The Basics
Id: 124743
Status: resolved
Priority: 0/
Queue: Function-Parameters

People
Owner: Nobody in particular
Requestors: Smylers [...] stripey.com
Cc:
AdminCc:

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



Subject: Breaks the true module when used in a Moo Role
Hi. Apologies for this bug report being so convoluted. I've only been able to get the bug to trigger when Function::Parameters is used with both true and Moo::Role. Here's a minimal Moo role that demonstrates the issue. Save this to RoleWithMethod.pm: package RoleWithMethod; use Moo::Role; use true; use Function::Parameters; method blah() {} Then trying to apply that role with Moo's with statement yields the complaint about the module not ending with a true value (which use true should have avoided): $ perl -MMoo -E 'with q[RoleWithMethod]' RoleWithMethod.pm did not return a true value at /usr/share/perl5/Module/Runtime.pm line 317. Note that this only happens when using Function::Parameters. Define a very similar RoleWithSub.pm, which still loads Function::Parameters but doesn't make use of it: package RoleWithSub; use Moo::Role; use true; use Function::Parameters; sub blah {} and that works fine, with the true module having the desired effect: $ perl -MMoo -E 'with q[RoleWithSub]' Note also that the problem doesn't occur if the role module is loaded directly itself, rather than leaving it to with to load it: $ perl -MMoo -MRoleWithMethod -E 'with q[RoleWithMethod]' This may not be really be a Function::Parameters bug, but the addition of Function::Parameters triggers it, so I'm reporting it here. Cheers.
Resolved (kind-of) by a workaround added to the true module and released as version 1.0. See Ticket #124745 for details. (Since that's a workaround, there may still be something that could be tweaked on this side. But since it's also been established to work fine on Perl v5.24 onwards, it probably isn't worth bothering.) Smylers