From: Peter Rabbitson Date: Sun, 16 Jun 2013 10:25:34 +0000 (+0200) Subject: _concrete_methods_of must return only methods, not any globslot X-Git-Tag: v1.003000~29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f656cac92a3274607aa97844ad90522110395e30;p=gitmo%2FRole-Tiny.git _concrete_methods_of must return only methods, not any globslot --- diff --git a/Changes b/Changes index 526d5fa..ef98ee0 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Fix _concrete_methods_of returning non-CODE entries + 1.002005 - 2013-02-01 - complain loudly if Class::Method::Modifiers is too old (and skip tests) - don't use $_ as loop variable when calling arbitrary code diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index af114d6..b076c8e 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -267,7 +267,7 @@ sub _concrete_methods_of { map { my $code = *{$stash->{$_}}{CODE}; # rely on the '' key we added in import for "no code here" - exists $not_methods->{$code||''} ? () : ($_ => $code) + ( ! $code or exists $not_methods->{$code||''} ) ? () : ($_ => $code) } grep !ref($stash->{$_}), keys %$stash }; }