test the type constraint directly, don't be clever
Matt S Trout [Fri, 18 May 2012 13:39:43 +0000 (13:39 +0000)]
lib/MooseX/Types/TypeDecorator.pm

index 6f02813..943bcd6 100644 (file)
@@ -117,8 +117,10 @@ handle $self->isa since AUTOLOAD can't.
 =cut
 
 sub isa {
-  return 1 if $_[1]->isa('Moose::Meta::TypeConstraint');
-  shift->_try_delegate('isa', @_)
+  my $self = shift;
+  return
+    $self->__type_constraint->isa(@_)
+    || $self->_try_delegate('isa', @_);
 }
 
 =head2 can