From: Fuji, Goro Date: Fri, 12 Nov 2010 06:38:13 +0000 (+0900) Subject: Revert "No duplicate check for role_type()" X-Git-Tag: 0.86~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=63da74fd7be3c1236f0ace8684f078ff48fd3e2a;p=gitmo%2FMouse.git Revert "No duplicate check for role_type()" This reverts commit ef223decd6bf1150e5219d150911404a11df072d. --- diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index bc32489..515bdba 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -4,7 +4,8 @@ use Mouse::Util; # enables strict and warnings use Mouse::Meta::TypeConstraint; use Mouse::Exporter; -use Carp (); +use Carp (); +use Scalar::Util (); Mouse::Exporter->setup_import_methods( as_is => [qw( @@ -211,7 +212,8 @@ sub role_type { return subtype $name => ( as => 'Object', optimized_as => sub { - return Mouse::Util::does_role($_[0], $role); + return Scalar::Util::blessed($_[0]) + && Mouse::Util::does_role($_[0], $role); }, role => $role, );