make auto_deref also handles isa not only ArrayRef and HashRef, but also ArrayRef...
[gitmo/Mouse.git] / lib / Mouse / Meta / Method / Accessor.pm
index af49197..38531bc 100644 (file)
@@ -88,7 +88,7 @@ sub generate_accessor_method_inline {
     }
 
     if ($should_deref) {
-        if (ref($constraint) && $constraint->name eq 'ArrayRef') {
+        if (ref($constraint) && $constraint->name =~ '^ArrayRef\b') {
             $accessor .= 'if (wantarray) {
                 return @{ '.$self.'->{'.$key.'} || [] };
             }';