From: Dave Rolsky Date: Fri, 29 Aug 2008 03:43:56 +0000 (+0000) Subject: Adding a role changes the method map, but it will not change the X-Git-Tag: 0.55_02~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2bed56975b7dda82bf1dcdb8540ea054953302ba;p=gitmo%2FMoose.git Adding a role changes the method map, but it will not change the package cache flag, so we need to reset that flag when adding a role. This fixes the bug tokuhirom found, which is tested in t/030_roles/031_roles_applied_in_create.t --- diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 4496b67..40c19f7 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -262,6 +262,7 @@ sub add_role { (blessed($role) && $role->isa('Moose::Meta::Role')) || confess "Roles must be instances of Moose::Meta::Role"; push @{$self->get_roles} => $role; + $self->reset_package_cache_flag; } sub calculate_all_roles {