projects
/
gitmo/Moose.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
0e8cddd
)
Don't assume that value that fails a duck type constraint is blessed or we get undef...
Dave Rolsky [Thu, 21 Apr 2011 20:33:28 +0000 (15:33 -0500)]
lib/Moose/Meta/TypeConstraint/DuckType.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Moose/Meta/TypeConstraint/DuckType.pm
b/lib/Moose/Meta/TypeConstraint/DuckType.pm
index
fa70470
..
3b1a1c0
100644
(file)
--- a/
lib/Moose/Meta/TypeConstraint/DuckType.pm
+++ b/
lib/Moose/Meta/TypeConstraint/DuckType.pm
@@
-99,6
+99,8
@@
sub get_message {
my @methods = grep { !$value->can($_) } @{ $self->methods };
my $class = blessed $value;
+ $class ||= $value;
+
return $class
. " is missing methods "
. english_list(map { "'$_'" } @methods);