From: Dave Rolsky Date: Fri, 17 Sep 2010 23:19:43 +0000 (-0500) Subject: If the parent type is ArrayRef and the type itself is also parameterizable, we need... X-Git-Tag: 1.15~145 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2e02551119770b14a2d74f0c1ab2f6b9ce074736;p=gitmo%2FMoose.git If the parent type is ArrayRef and the type itself is also parameterizable, we need to check the whole type, not just members. --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm index 5e655d5..3280cf1 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm @@ -101,7 +101,9 @@ sub _check_new_members_only { # If the parent is ArrayRef, that means we can just check the new members # of the collection, because we know that we will always be generating an # ArrayRef. - return 1 if $tc->parent->name eq 'ArrayRef'; + return 1 + if $tc->parent->name eq 'ArrayRef' + && $tc->isa('Moose::Meta::TypeConstraint::Parameterized'); # If our parent is something else ( subtype 'Foo' as 'ArrayRef[Str]' ) # then there may be additional constraints on the whole value, as opposed