From: Dagfinn Ilmari Mannsåker Date: Fri, 26 Oct 2012 00:41:30 +0000 (+0100) Subject: don't die when looking for 'DOES' on perl < 5.10 (RT#80402) X-Git-Tag: v1.002001~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=211178eae196738ef8e14e2fa4109a2800386d8e;p=gitmo%2FRole-Tiny.git don't die when looking for 'DOES' on perl < 5.10 (RT#80402) --- diff --git a/Changes b/Changes index 1c950b3..e0988b3 100644 --- a/Changes +++ b/Changes @@ -1,4 +1,5 @@ - t/does-Moo.t moved to 'xt' (RT#80290) + - don't die when looking for 'DOES' on perl < 5.10 (RT#80402) 1.002000 - 2012-10-19 - load class in addition to roles when using create_class_from_roles diff --git a/lib/Role/Tiny.pm b/lib/Role/Tiny.pm index 9ebe242..3fd8b1d 100644 --- a/lib/Role/Tiny.pm +++ b/lib/Role/Tiny.pm @@ -321,7 +321,7 @@ sub _install_does { # add does() only if they don't have one *{_getglob "${to}::does"} = \&does_role unless $to->can('does'); - return if ($to->can('DOES') and $to->can('DOES') != UNIVERSAL->can('DOES')); + return if ($to->can('DOES') and $to->can('DOES') != (UNIVERSAL->can('DOES') || 0)); my $existing = $to->can('DOES') || $to->can('isa') || $FALLBACK; my $new_sub = sub {