Created
August 25, 2011 13:15
-
-
Save monken/1170622 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Moose/Meta/TypeConstraint/DuckType.pm b/lib/Moose/Meta/TypeConstraint/DuckType.pm | |
index 8957156..82fc83c 100644 | |
--- a/lib/Moose/Meta/TypeConstraint/DuckType.pm | |
+++ b/lib/Moose/Meta/TypeConstraint/DuckType.pm | |
@@ -24,10 +24,10 @@ my $inliner = sub { | |
return 'Scalar::Util::blessed(' . $val . ') ' | |
. '&& Scalar::Util::blessed(' . $val . ') ne "Regexp" ' | |
- . '&& &List::MoreUtils::all(' | |
- . 'sub { ' . $val . '->can($_) }, ' | |
+ . '&& do { my $obj = ' . $val . '; &List::MoreUtils::all(' | |
+ . 'sub { $obj->can($_) }, ' | |
. join(', ', map { B::perlstring($_) } @{ $self->methods }) | |
- . ')'; | |
+ . ') }'; | |
}; | |
sub new { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment