From: Matt S Trout Date: Wed, 11 Apr 2012 20:41:00 +0000 (+0000) Subject: method cache is required so Moose::Role inhalation can populate it X-Git-Tag: v1.000_900~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb8fcb2d155c554826c9effce2b710fcddf2defb;p=gitmo%2FRole-Tiny.git method cache is required so Moose::Role inhalation can populate it --- diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index e5e3e1f..4289fec 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -171,6 +171,7 @@ sub apply_roles_to_package { } keys %conflicts; die $fail; } + delete $INFO{$to}{methods}; # reset since we're about to add methods $me->apply_single_role_to_package($to, $_) for @roles; $APPLIED_TO{$to}{join('|',@roles)} = 1; } @@ -233,7 +234,7 @@ sub _concrete_methods_of { # grab role symbol table my $stash = do { no strict 'refs'; \%{"${role}::"}}; my $not_methods = $info->{not_methods}; - +{ + $info->{methods} ||= +{ # grab all code entries that aren't in the not_methods list map { my $code = *{$stash->{$_}}{CODE};