use warnings;
use metaclass;
-use overload '""' => sub { shift->name }, # stringify to tc name
+use overload '0+' => sub { refaddr(shift) }, # id an object
+ '""' => sub { shift->name }, # stringify to tc name
+ bool => sub { 1 },
fallback => 1;
use Scalar::Util qw(blessed refaddr);
use base qw(Class::MOP::Object);
-our $VERSION = '0.93_02';
+our $VERSION = '1.08';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
}
else {
$value = (defined $value ? overload::StrVal($value) : 'undef');
- return "Validation failed for '" . $self->name . "' failed with value $value";
+ return "Validation failed for '" . $self->name . "' with value $value";
}
}
my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) or return;
- return 1 if refaddr($self) == refaddr($other);
+ return 1 if $self == $other;
if ( $self->has_hand_optimized_type_constraint and $other->has_hand_optimized_type_constraint ) {
return 1 if $self->hand_optimized_type_constraint == $other->hand_optimized_type_constraint;
return if $other->has_parent;
}
- return 1;
+ return;
}
sub is_a_type_of {
=head1 DESCRIPTION
This class represents a single type constraint. Moose's built-in type
-constraints, as well as constraints you define, are all store in a
+constraints, as well as constraints you define, are all stored in a
L<Moose::Meta::TypeConstraint::Registry> object as objects of this
class.