Re: Announcement: Moose 2.0800 is released!
[email protected] (Jesse Luehrs)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Mar 28, 2013 at 08:59:51AM -0700, Ovid wrote:
> So the following code will print 'c' (previously it was a fatal error
> requiring the dev to state exactly what they intended):
>
> Â Â use 5.01000;
> Â Â { package a; use Moose::Role; sub result { 'a' } }
> Â Â { package b; use Moose::Role; }
> Â Â { package c; use Moose::Role; with qw(a b); sub result { 'c' } }
> Â Â { package d; use Moose::Role; with qw(c); }
> Â Â {
> Â Â Â Â package Consumer; use Moose;
> Â Â Â Â with 'd';
> Â Â }
> Â Â say Consumer->new->result;
>
> And this will print 'a', even though the class is consuming what
> appears to be the same role:
>
> Â Â use 5.01000;
> Â Â { package a; use Moose::Role; sub result { 'a' } }
> Â Â { package b; use Moose::Role; }
> Â Â { package c; use Moose::Role; with qw(a b); sub result { 'c' } }
> Â Â { package d; use Moose::Role; with qw(c); }
> Â Â {
> Â Â Â Â package Consumer; use Moose;
> Â Â Â Â with 'd';
> Â Â }
> Â Â say Consumer->new->result;
>
> Note that in the above examples, I have changed nothing but the order
> in which the roles are consumed, but my behavior has changed.
I can't tell what point you're trying to make here, because these two
code samples are identical.
-doy