should accept subclasses
Ricardo SIGNES [Thu, 4 Dec 2008 19:03:40 +0000 (19:03 +0000)]
Changes
lib/Mouse/Meta/Attribute.pm

diff --git a/Changes b/Changes
index 704df1e..28061c2 100644 (file)
--- 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
index 94bb535..95cc876 100644 (file)
@@ -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 {