my $check = delete $args{optimized};
- if($args{_compiled_type_constraint}){
- Carp::cluck("'_compiled_type_constraint' has been deprecated, use 'optimized' instead")
- if Mouse::Util::_MOUSE_VERBOSE;
-
- $check = $args{_compiled_type_constraint};
- }
-
if($check){
$args{hand_optimized_type_constraint} = $check;
$args{compiled_type_constraint} = $check;
);
}
+sub name;
+sub parent;
+sub message;
+sub has_coercion;
+sub _compiled_type_constraint;
+sub _compiled_type_coercion;
+
+sub compile_type_constraint;
+
sub _add_type_coercions{
my $self = shift;
sub coerce {
my $self = shift;
+ my $coercion = $self->_compiled_type_coercion;
+ if(!$coercion){
+ Carp::confess("Cannot coerce without a type coercion");
+ }
+
return $_[0] if $self->_compiled_type_constraint->(@_);
- my $coercion = $self->_compiled_type_coercion;
- return $coercion ? $coercion->(@_) : $_[0];
+ return $coercion->(@_);
}
sub get_message {
=head1 VERSION
-This document describes Mouse version 0.4501
+This document describes Mouse version 0.50
=head1 DESCRIPTION