X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FRole.pm;h=af7dc874fc01a81342dc79ba0accb70997258d60;hb=1f7799268624a1daa3d84d8326f8f0bdc4ef8c75;hp=8a9d45b153d2a7670f7597d197b0d891e3c6e73a;hpb=7bffa230cb5d051d895a8393dcc0b096b91f24e0;p=gitmo%2FMoose.git diff --git a/lib/Moose/Role.pm b/lib/Moose/Role.pm index 8a9d45b..af7dc87 100644 --- a/lib/Moose/Role.pm +++ b/lib/Moose/Role.pm @@ -12,7 +12,7 @@ use Sub::Name 'subname'; use Sub::Exporter; -our $VERSION = '0.05'; +our $VERSION = '0.06'; use Moose (); @@ -31,6 +31,7 @@ use Moose::Util::TypeConstraints; subtype $role => as 'Role' => where { $_->does($role) } + => optimize_as { blessed($_[0]) && $_[0]->can('does') && $_[0]->does($role) } unless find_type_constraint($role); my $meta;