nopasted this on #moose earlier, but might as well post it for
posterity as well:

Given this tiny program:
-----
package R;
use Moose::Role;
after foo => sub { warn "R::foo" };

package A;
use Moose;
sub foo { warn "A::foo" }

package B;
use Moose;
extends 'A';
#after foo => sub { };

package C;
use Moose;
extends 'B';
after foo => sub { warn "C::foo" };

package main;

Moose::Util::apply_all_roles('B', 'R');

C->foo;
---
Why would the role application be relying on the presence or not of a
method modifier in B?  "Compile time" application with "with 'R'" in B
works as expected.  Removing the modifier in C also makes the runtime
application take, so it appears that something is cached in C?
-- 
Lars Balker Rasmussen                                        Consult::Perl

Reply via email to