From: Dave Rolsky Date: Mon, 19 Jul 2010 17:01:28 +0000 (-0500) Subject: Don't try to inline a coercion unless the type constraint has a coercion X-Git-Tag: 1.09~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bb8afe3d0c62c41f023cb77d8a200da3bd18231e;p=gitmo%2FMoose.git Don't try to inline a coercion unless the type constraint has a coercion --- diff --git a/lib/Moose/Meta/Method/Accessor.pm b/lib/Moose/Meta/Method/Accessor.pm index 7b6517a..fa637b2 100644 --- a/lib/Moose/Meta/Method/Accessor.pm +++ b/lib/Moose/Meta/Method/Accessor.pm @@ -166,7 +166,7 @@ sub _inline_check_coercion { my $attr = $self->associated_attribute; - return '' unless $attr->should_coerce; + return '' unless $attr->should_coerce && $attr->type_constraint->has_coercion; return "$value = \$attr->type_constraint->coerce($value);"; }