From: Stevan Little Date: Sun, 25 May 2008 02:13:06 +0000 (+0000) Subject: 0.45 X-Git-Tag: 0_55~139 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2887c827f2173546432a93a679654006b96ec7ff;p=gitmo%2FMoose.git 0.45 --- diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 6f55997..df1074d 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -201,8 +201,18 @@ sub get_method_map { #next unless $self->does_role($role); } else { - next if ($pkg || '') ne $class_name || - (($name || '') ne '__ANON__' && ($pkg || '') ne $class_name); + + # NOTE: + # in 5.10 constant.pm the constants show up + # as being in the right package, but in pre-5.10 + # they show up as constant::__ANON__ so we + # make an exception here to be sure that things + # work as expected in both. + # - SL + unless ($pkg eq 'constant' && $name eq '__ANON__') { + next if ($pkg || '') ne $class_name || + (($name || '') ne '__ANON__' && ($pkg || '') ne $class_name); + } } diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 1d0d8bc..6952b29 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -310,8 +310,17 @@ sub get_method_map { next unless $self->does_role($role); } else { - next if ($pkg || '') ne $role_name || - (($name || '') ne '__ANON__' && ($pkg || '') ne $role_name); + # NOTE: + # in 5.10 constant.pm the constants show up + # as being in the right package, but in pre-5.10 + # they show up as constant::__ANON__ so we + # make an exception here to be sure that things + # work as expected in both. + # - SL + unless ($pkg eq 'constant' && $name eq '__ANON__') { + next if ($pkg || '') ne $role_name || + (($name || '') ne '__ANON__' && ($pkg || '') ne $role_name); + } } $map->{$symbol} = $method_metaclass->wrap(