X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FClass.pm;h=39b45e078a1cc7722050426a51a97154b2d92642;hb=b3853db9543d3f4da31a681df2300fc2de3c3077;hp=931ef325fe3fba04b1155cb1cab3ed2ec228d5d1;hpb=0779da922a64aa891bc2708b6fc8de4d4fdffa11;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Class.pm b/lib/Moose/Meta/TypeConstraint/Class.pm index 931ef32..39b45e0 100644 --- a/lib/Moose/Meta/TypeConstraint/Class.pm +++ b/lib/Moose/Meta/TypeConstraint/Class.pm @@ -7,7 +7,8 @@ use metaclass; use Scalar::Util 'blessed'; use Moose::Util::TypeConstraints (); -our $VERSION = '0.56'; +our $VERSION = '0.59'; +$VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; use base 'Moose::Meta::TypeConstraint'; @@ -60,6 +61,7 @@ sub equals { my $other = Moose::Util::TypeConstraints::find_type_constraint($type_or_name); + return unless defined $other; return unless $other->isa(__PACKAGE__); return $self->class eq $other->class; @@ -82,6 +84,8 @@ sub is_subtype_of { } my $type = Moose::Util::TypeConstraints::find_type_constraint($type_or_name_or_class); + + return unless defined $type; if ( $type->isa(__PACKAGE__) ) { # if $type_or_name_or_class isn't a class, it might be the TC name of another ::Class type