X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMooseX%2FMeta%2FTypeConstraint%2FStructured.pm;fp=lib%2FMooseX%2FMeta%2FTypeConstraint%2FStructured.pm;h=44691e43f234621158ae42ccbf63f46f47eba846;hb=fd29a93ceffa03fc063ad61f6dd9d075f33cf564;hp=a9aa0e5193abdd23b54f7957e97c306a2f94693f;hpb=5bd9a68e5409a82eb7e82289e35e1eda939570b3;p=gitmo%2FMooseX-Types-Structured.git diff --git a/lib/MooseX/Meta/TypeConstraint/Structured.pm b/lib/MooseX/Meta/TypeConstraint/Structured.pm index a9aa0e5..44691e4 100644 --- a/lib/MooseX/Meta/TypeConstraint/Structured.pm +++ b/lib/MooseX/Meta/TypeConstraint/Structured.pm @@ -232,9 +232,7 @@ 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); - if ( $other->isa(__PACKAGE__) ) { if ( $other->type_constraints and $self->type_constraints ) { if ( $self->parent->is_a_type_of($other->parent) ) { @@ -294,7 +292,8 @@ sub _type_constraints_op_all { $_ = Moose::Util::TypeConstraints::find_or_create_isa_type_constraint($_) for $self_type_constraint, $other_type_constraint; - $self_type_constraint->$op($other_type_constraint) or return; + my $result = $self_type_constraint->$op($other_type_constraint); + return unless $result; } return 1; ##If we get this far, everything is good.