use type_constraint_obj here
Jesse Luehrs [Mon, 18 Oct 2010 21:59:27 +0000 (16:59 -0500)]
lib/Moose/Meta/Method/Accessor.pm

index 59c9341..7d81fa1 100644 (file)
@@ -172,7 +172,7 @@ sub _inline_check_coercion {
     my $attr = $self->associated_attribute;
 
     return '' unless $attr->should_coerce && $attr->type_constraint->has_coercion;
-    return "$value = \$attr->type_constraint->coerce($value);";
+    return "$value = \$type_constraint_obj->coerce($value);";
 }
 
 sub _inline_check_required {