don't die when looking for 'DOES' on perl < 5.10 (RT#80402)
Dagfinn Ilmari Mannsåker [Fri, 26 Oct 2012 00:41:30 +0000 (01:41 +0100)]
Changes
lib/Role/Tiny.pm

diff --git a/Changes b/Changes
index 1c950b3..e0988b3 100644 (file)
--- 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
index 9ebe242..3fd8b1d 100644 (file)
@@ -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 {