This queue is for tickets about the MooseX-Role-Parameterized CPAN distribution.

Report information
The Basics
Id:
45393
Status:
resolved
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
makk384 [...] gmail.com
Cc:
AdminCc:

BugTracker
Severity:
Normal
Broken in:
0.04
Fixed in:
(no value)



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.
Hey Mark, Thanks for your bug report. We're aware of this composition bug, I even reported it myself :) https://rt.cpan.org/Ticket/Display.html?id=43297 On Fri Apr 24 11:01:37 2009, MMORGAN wrote:
Show quoted text
> 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).
Yep, you don't need to tell me how awesome roles are.. :) Unfortunately there's no easy way to hook into the Moose role summation code to make this work. Hell, I'm not even sure how to detect that the user is *trying* to include a parameterized role so that we can throw an error instead of silently failing. I need to spend some quality time with the role implementation to figure out how to proceed. Shawn
Hey Mark, This will be fixed in the next release. I'm just waiting for a Moose release. Thanks! Shawn


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.