Skip Menu |

This queue is for tickets about the Moo CPAN distribution.

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

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

Bug Information
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.