make auto_deref also handles isa not only ArrayRef and HashRef, but also ArrayRef...
[gitmo/Mouse.git] / lib / Mouse / Meta / Attribute.pm
index 73e8f9e..dfae8b2 100644 (file)
@@ -209,8 +209,7 @@ sub validate_args {
 
     confess "You cannot auto-dereference anything other than a ArrayRef or HashRef on attribute ($name)"
         if $args->{auto_deref}
-        && $args->{isa} ne 'ArrayRef'
-        && $args->{isa} ne 'HashRef';
+        && $args->{isa} !~ /^(?:ArrayRef|HashRef)(?:\[.*\])?$/;
 
     if ($args->{trigger}) {
         if (ref($args->{trigger}) eq 'HASH') {