When combining roles based on MooseX::Role::Parameter with others using
normal Moose::Role within a single 'with' statement, the parameterized
roles do not load correctly. When done seperately, they do. The
following case demonstrates the issue:
===
package ParameterizedRole;
use MooseX::Role::Parameterized;
parameter xxx => (
isa => 'Str',
required => 1,
);
role {
my ( $p ) = @_;
die "dying in ParameterizedRole::role";
};
package UnparameterizedRole;
use Moose::Role;
has yyy => (
isa => 'Str',
required => 1,
);
package Consumer;
use Moose;
with 'ParameterizedRole' => { xxx => 1 },
'UnparameterizedRole';
package main;
my $con = Consumer->new( xxx => 1, yyy => 2 );
===
This should die with an error of 'dying in ParameterizedRole::role', but
instead silently continues on. If the 'with' statements are split up,
the expected behaviour occours (die with 'dying in
ParameterizedRole::role at bug.pl line 13.').
By requiring multiple with statements, the benefit of a single 'with'
for noticing that two roles both implement the same method, without
requiring it to be disambiguated by the consumer of the roles doesn't
happen (more a Moose issue itself, but made more likely with the
behaviour of this class).
Mark.
Bug #45393 for MooseX-Role-Parameterized: Role summation with a parameterized role is broken
This queue is for tickets about the MooseX-Role-Parameterized CPAN distribution.
Report information
The Basics
People
Owner:
Nobody in particular
Requestors:
makk384 [...] gmail.com
Cc:
AdminCc:
BugTracker
Severity:
Normal
Broken in:
0.04
Fixed in:
(no value)
This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.
Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.