stop closing over the type constraint object
[gitmo/Moose.git] / lib / Moose / Meta / Method / Accessor / Native / Writer.pm
index 1ea3ced..06f3042 100644 (file)
@@ -38,7 +38,7 @@ sub _inline_writer_core {
         $self->_inline_check_argument_count,
         $self->_inline_process_arguments($inv, $slot_access),
         $self->_inline_check_arguments('for writer'),
-        $self->_inline_check_lazy($inv, '$type_constraint', '$type_coercion', '$type_constraint_obj'),
+        $self->_inline_check_lazy($inv, '$type_constraint', '$type_coercion', '$type_message'),
     );
 
     if ($self->_return_value($slot_access)) {
@@ -50,7 +50,7 @@ sub _inline_writer_core {
     push @code, (
         $self->_inline_coerce_new_values,
         $self->_inline_copy_native_value(\$potential),
-        $self->_inline_tc_code($potential, '$type_constraint', '$type_coercion', '$type_constraint_obj'),
+        $self->_inline_tc_code($potential, '$type_constraint', '$type_coercion', '$type_message'),
         $self->_inline_get_old_value_for_trigger($inv, $old),
         $self->_inline_capture_return_value($slot_access),
         $self->_inline_set_new_value($inv, $potential, $slot_access),
@@ -109,7 +109,7 @@ sub _inline_copy_native_value {
 around _inline_tc_code => sub {
     my $orig = shift;
     my $self = shift;
-    my ($value, $tc, $coercion, $tc_obj, $for_lazy) = @_;
+    my ($value, $tc, $coercion, $message, $for_lazy) = @_;
 
     return unless $for_lazy || $self->_constraint_must_be_checked;
 
@@ -119,7 +119,7 @@ around _inline_tc_code => sub {
 around _inline_check_constraint => sub {
     my $orig = shift;
     my $self = shift;
-    my ($value, $tc, $tc_obj, $for_lazy) = @_;
+    my ($value, $tc, $message, $for_lazy) = @_;
 
     return unless $for_lazy || $self->_constraint_must_be_checked;