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.