This queue is for tickets about the Moo CPAN distribution.

Report information
The Basics
Id:
121838
Status:
new
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
MAUKE [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
2.003002
Fixed in:
(no value)



Subject: has '+foo' doesn't work between roles
$ cat try.pl #!/usr/bin/env perl use strict; use warnings; { package RoleA; use Moo::Role; has 'foo' => ( is => 'ro', required => 1, ); } { package RoleB; use Moo::Role; has '+foo' => ( default => sub { 42 }, ); } __END__ $ perl try.pl Must have an is at try.pl line 21. I would have expected RoleB to end up with the equivalent of has 'foo' => ( is => 'ro', required => 1, default => sub { 42 }, ); Instead it seems like the '+' is just ignored.
On Tue May 23 16:57:25 2017, MAUKE wrote:
Show quoted text
> $ cat try.pl > #!/usr/bin/env perl > use strict; > use warnings; > > { > package RoleA; > use Moo::Role; > > has 'foo' => ( > is => 'ro', > required => 1, > ); > } > > { > package RoleB; > use Moo::Role;
Correction: Insert with 'RoleA'; here.
Show quoted text
> > has '+foo' => ( > default => sub { 42 }, > ); > } > __END__ > > $ perl try.pl > Must have an is at try.pl line 21.
Unfortunately adding the missing 'with' doesn't change the error, just the line number: Must have an is at try.pl line 23.
Show quoted text
> I would have expected RoleB to end up with the equivalent of > has 'foo' => ( > is => 'ro', > required => 1, > default => sub { 42 }, > ); > > Instead it seems like the '+' is just ignored.


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.