From: Dave Rolsky Date: Sat, 18 Sep 2010 04:02:03 +0000 (-0500) Subject: More TC handling fixes X-Git-Tag: 1.15~140 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b26c2595ca7c179a1d73d38408d6d1299d1c0ddb;p=gitmo%2FMoose.git More TC handling fixes --- diff --git a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm index f394c52..fdfb001 100644 --- a/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm +++ b/lib/Moose/Meta/Method/Accessor/Native/Array/Writer.pm @@ -90,8 +90,8 @@ sub _inline_tc_code { return $self->_inline_check_member_constraint($new_value); } else { - return $self->_inline_check_coercion($potential_value) . "\n" - . $self->_inline_check_constraint($potential_value); + return $self->_inline_check_coercion( '\\' . $potential_value ) . "\n" + . $self->_inline_check_constraint( '\\' . $potential_value ); } } @@ -123,7 +123,7 @@ sub _check_new_members_only { # just the members. return 1 if $tc->parent->name eq 'ArrayRef' - && !$tc->constraint; + && $tc->isa('Moose::Meta::TypeConstraint::Parameterized'); return 0; } @@ -160,7 +160,7 @@ sub _inline_check_constraint { return q{} unless $self->_constraint_must_be_checked; - return $self->SUPER::_inline_check_constraint( '\\' . $_[0] ); + return $self->SUPER::_inline_check_constraint( $_[0] ); } sub _capture_old_value { return q{} }