forgot we had List::MoreUtils
Chris Prather [Fri, 27 Mar 2009 22:16:55 +0000 (18:16 -0400)]
lib/Moose/Util/TypeConstraints.pm

index bf70f32..b792f59 100644 (file)
@@ -374,7 +374,7 @@ sub duck_type {
             'Object',
             sub {
                 my $obj = $_;
-                for (@methods) { return 0 unless $obj->can($_) }
+                return 0 unless all { $obj->can($_) } @methods;
                 return 1;
             },
             sub {