Work around List::MoreUtils::all being misparsed under 5.10 (no idea why that was...
Dave Rolsky [Mon, 6 Jun 2011 19:08:58 +0000 (14:08 -0500)]
lib/Moose/Meta/TypeConstraint/Union.pm

index c0c846b..0492e6e 100644 (file)
@@ -75,7 +75,13 @@ sub _actually_compile_type_constraint {
 sub can_be_inlined {
     my $self = shift;
 
-    return all { $_->can_be_inlined } @{ $self->type_constraints };
+    # This was originally done with all() from List::MoreUtils, but that
+    # caused some sort of bizarro parsing failure under 5.10.
+    for my $tc ( @{ $self->type_constraints } ) {
+        return 0 unless $tc->can_be_inlined;
+    }
+
+    return 1;
 }
 
 sub _inline_check {