X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint.pm;h=f84baf1df1a718c20e19fc4adc1ce60ed6797810;hb=55c22540a16ae9b8989e385af93e838570206d95;hp=d292bcce5b69916fd3cf7e0acdbb3ec353da4e7f;hpb=ed90007bbf809739645439d7f47bafaffecf384c;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint.pm b/lib/Moose/Meta/TypeConstraint.pm index d292bcc..f84baf1 100644 --- a/lib/Moose/Meta/TypeConstraint.pm +++ b/lib/Moose/Meta/TypeConstraint.pm @@ -7,6 +7,7 @@ use metaclass; 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); @@ -14,7 +15,7 @@ use Sub::Name qw(subname); use base qw(Class::MOP::Object); -our $VERSION = '1.05'; +our $VERSION = '1.15'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -134,7 +135,7 @@ sub equals { my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) or return; - return 1 if 0+$self == 0+$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;