Don't assume that value that fails a duck type constraint is blessed or we get undef...
[gitmo/Moose.git] / lib / Moose / Meta / TypeConstraint / DuckType.pm
index fa70470..3b1a1c0 100644 (file)
@@ -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);