X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types-Structured.git;a=blobdiff_plain;f=lib%2FMooseX%2FMeta%2FTypeConstraint%2FStructured.pm;fp=lib%2FMooseX%2FMeta%2FTypeConstraint%2FStructured.pm;h=a770be01048689d0c296167ad70872929c011fad;hp=0db946f9a5319d265867b26ff51c480ab8710575;hb=8c18714858905491191a133640ad8fab1be876f0;hpb=2bcb44acb5b4658e4017e081dcbea29c7bf2528f diff --git a/lib/MooseX/Meta/TypeConstraint/Structured.pm b/lib/MooseX/Meta/TypeConstraint/Structured.pm index 0db946f..a770be0 100644 --- a/lib/MooseX/Meta/TypeConstraint/Structured.pm +++ b/lib/MooseX/Meta/TypeConstraint/Structured.pm @@ -197,7 +197,8 @@ Override the base class behavior. sub equals { my ( $self, $type_or_name ) = @_; - my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); + my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) + or return; return unless $other->isa(__PACKAGE__); @@ -210,7 +211,8 @@ sub equals { sub is_a_type_of { my ( $self, $type_or_name ) = @_; - my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); + my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) + or return; if ( $other->isa(__PACKAGE__) and @{ $other->type_constraints || [] }) { if ( $self->parent->is_a_type_of($other->parent) ) { @@ -228,7 +230,8 @@ sub is_a_type_of { sub is_subtype_of { my ( $self, $type_or_name ) = @_; - my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); + my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name) + or return; if ( $other->isa(__PACKAGE__) ) { if ( $other->type_constraints and $self->type_constraints ) { if ( $self->parent->is_a_type_of($other->parent) ) {