not sure what the original intent was, but it's certainly not breaking
any aliasing in this form
shift->associated_attribute->_inline_tc_code(@_);
}
+sub _inline_check_coercion {
+ shift->associated_attribute->_inline_check_coercion(@_);
+}
+
sub _inline_check_constraint {
shift->associated_attribute->_inline_check_constraint(@_);
}
return $self->$orig(@_);
};
-sub _inline_check_coercion {
- my $self = shift;
- my ($value, $tc, $tc_obj) = @_;
-
- my $attr = $self->associated_attribute;
- return unless $attr->should_coerce && $attr->type_constraint->has_coercion;
-
- # We want to break the aliasing in @_ in case the coercion tries to make a
- # destructive change to an array member.
- return $value . ' = ' . $tc_obj . '->coerce(' . $value . ');';
-}
-
around _inline_check_constraint => sub {
my $orig = shift;
my $self = shift;