From: Dave Rolsky Date: Tue, 14 Sep 2010 16:18:09 +0000 (-0500) Subject: Fix weird bug that is probably a bug in List::MoreUtils X-Git-Tag: 1.14~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5c56b608d2ced90a682cc6443d94b54aa6582785;p=gitmo%2FMoose.git Fix weird bug that is probably a bug in List::MoreUtils --- diff --git a/lib/Moose/Meta/TypeConstraint/Union.pm b/lib/Moose/Meta/TypeConstraint/Union.pm index 658e810..c8c7ce1 100644 --- a/lib/Moose/Meta/TypeConstraint/Union.pm +++ b/lib/Moose/Meta/TypeConstraint/Union.pm @@ -7,7 +7,6 @@ use metaclass; use Moose::Meta::TypeCoercion::Union; -use List::MoreUtils qw(any); use List::Util qw(first); our $VERSION = '1.13'; @@ -46,7 +45,9 @@ sub coercion { return $self->{coercion} if exists $self->{coercion}; - if ( any { $_->has_coercion } @{ $self->type_constraints } ) { + # Using any instead of grep here causes a weird error with some corner + # cases when MX::Types is in use. See RT #61001. + if ( grep { $_->has_coercion } @{ $self->type_constraints } ) { return $self->{coercion} = Moose::Meta::TypeCoercion::Union->new( type_constraint => $self ); }