From: Ricardo SIGNES Date: Thu, 4 Dec 2008 19:03:40 +0000 (+0000) Subject: should accept subclasses X-Git-Tag: 0.19~147 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3fc40cfff950b0e203d29ae2216e74d643a7c9ea;p=gitmo%2FMouse.git should accept subclasses --- diff --git a/Changes b/Changes index 704df1e..28061c2 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ Revision history for Mouse 0.12 + * make class-like types behave more like Moose; subclasses OK! (rjbs) 0.11 Sun Nov 2 11:35:04 2008 * Throw an error if accessor/predicate/clearer/handles code eval fails diff --git a/lib/Mouse/Meta/Attribute.pm b/lib/Mouse/Meta/Attribute.pm index 94bb535..95cc876 100644 --- a/lib/Mouse/Meta/Attribute.pm +++ b/lib/Mouse/Meta/Attribute.pm @@ -294,7 +294,7 @@ sub find_type_constraint { my $checker = Mouse::TypeRegistry->optimized_constraints->{$type}; return $checker if $checker; - return sub { blessed($_) && blessed($_) eq $type }; + return sub { blessed($_) && $_->isa($type) }; } sub verify_type_constraint {