my ($self, $name, %args) = @_;
Carp::cluck("$self->canonicalize_args has been deprecated."
- . "Use \$self->_process_options instead.")
- if Mouse::Util::_MOUSE_VERBOSE;
+ . "Use \$self->_process_options instead.");
return %args;
}
my ($self, $class, $name, %args) = @_;
Carp::cluck("$self->create has been deprecated."
- . "Use \$meta->add_attribute and \$attr->install_accessors instead.")
- if Mouse::Util::_MOUSE_VERBOSE;
+ . "Use \$meta->add_attribute and \$attr->install_accessors instead.");
# noop
return $self;
return 1 if !$type_constraint;
return 1 if $type_constraint->check($value);
- $self->verify_type_constraint_error($value, $type_constraint);
+ $self->_throw_type_constraint_error($value, $type_constraint);
}
-sub verify_type_constraint_error {
+sub _throw_type_constraint_error {
my($self, $value, $type) = @_;
$self->throw_error(
my %args = ($self->get_parent_args($class, $name), @_);
Carp::cluck("$self->clone_parent has been deprecated."
- . "Use \$meta->add_attribute and \$attr->install_accessors instead.")
- if Mouse::Util::_MOUSE_VERBOSE;
+ . "Use \$meta->add_attribute and \$attr->install_accessors instead.");
$self->clone_and_inherited_args($class, $name, %args);
}
$accessor .=
"\n".
'$compiled_type_constraint->('.$value.') or
- $attribute->verify_type_constraint_error('.$value.', $constraint);' . "\n";
+ $attribute->_throw_type_constraint_error('.$value.', $constraint);' . "\n";
}
# if there's nothing left to do for the attribute we can return during
$accessor .= "my \$tmp = $value;\n";
$accessor .= "\$compiled_type_constraint->(\$tmp)";
- $accessor .= " || \$attribute->verify_type_constraint_error(\$tmp, \$constraint);\n";
+ $accessor .= " || \$attribute->_throw_type_constraint_error(\$tmp, \$constraint);\n";
$accessor .= "$slot = \$tmp;\n";
}
else{
my $post_process = '';
if(defined $type_constraint){
$post_process .= "\$checks[$index]->($instance_slot)";
- $post_process .= " or $attr_var->verify_type_constraint_error($instance_slot, $constraint_var);\n";
+ $post_process .= " or $attr_var->_throw_type_constraint_error($instance_slot, $constraint_var);\n";
}
if($is_weak_ref){
$post_process .= "Scalar::Util::weaken($instance_slot) if ref $instance_slot;\n";