From: Matt S Trout Date: Fri, 18 May 2012 13:39:43 +0000 (+0000) Subject: test the type constraint directly, don't be clever X-Git-Tag: v0.32~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e73ec86fc0b97ac2130e57e79ebb9028eb0e973;p=gitmo%2FMooseX-Types.git test the type constraint directly, don't be clever --- diff --git a/lib/MooseX/Types/TypeDecorator.pm b/lib/MooseX/Types/TypeDecorator.pm index 6f02813..943bcd6 100644 --- a/lib/MooseX/Types/TypeDecorator.pm +++ b/lib/MooseX/Types/TypeDecorator.pm @@ -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