X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoo%2FHandleMoose.pm;h=fb68afd410743032dccf30bf989e7b23e036cc61;hb=c85a5738ea2a6f7de9ab1caf31fbf365c1c1e771;hp=2de0c7b3558cbef984c18610ef3be4c245953f69;hpb=44a44498b0bef2040298807d349a879d4a790d1a;p=gitmo%2FMoo.git diff --git a/lib/Moo/HandleMoose.pm b/lib/Moo/HandleMoose.pm index 2de0c7b..fb68afd 100644 --- a/lib/Moo/HandleMoose.pm +++ b/lib/Moo/HandleMoose.pm @@ -65,6 +65,14 @@ sub inject_real_metaclass_for { }; my %methods = %{Role::Tiny->_concrete_methods_of($name)}; + + # if stuff gets added afterwards, _maybe_reset_handlemoose should + # trigger the recreation of the metaclass but we need to ensure the + # Role::Tiny cache is cleared so we don't confuse Moo itself. + if (my $info = $Role::Tiny::INFO{$name}) { + delete $info->{methods}; + } + # needed to ensure the method body is stable and get things named Sub::Defer::undefer_sub($_) for grep defined, values %methods; my @attrs;