From: Jesse Luehrs Date: Wed, 20 Jul 2011 14:49:25 +0000 (-0500) Subject: actually, don't just call random ->does methods we don't control X-Git-Tag: 2.0300~139 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=43781cc34ec643733d979278520187f0d8afe2ef;p=gitmo%2FMoose.git actually, don't just call random ->does methods we don't control --- diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index da44827..63a4da5 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -44,7 +44,7 @@ sub find_meta { Class::MOP::class_of(@_) } sub does_role { my ($class_or_obj, $role) = @_; - if (try { $class_or_obj->can('does') }) { + if (try { $class_or_obj->isa('Moose::Object') }) { return $class_or_obj->does($role); }