"Peter Flanigan via RT" <bug-Moo@rt.cpan.org> writes:
Show quoted text> I upgraded just one module, Moo from 1.005000 to 1.006000 and now I get
>
> Operation "eq": no method found,
> left argument in overloaded package Type::Coercion,
> right argument has no overloaded magic at
> /home/pjf/Perl/lib/perl5/Method/Generate/Accessor.pm line 72.
You don't say which version of perl you're using,
Show quoted text
but this test failure is on perl 5.10.1, which has buggy overloading and
loses the fallback value if you call overload->import.
Type::Coercion does
use overload
q("") => sub { caller =~ m{^(Moo::HandleMoose|Sub::Quote)}
? overload::StrVal($_[0]) : $_[0]->display_name },
q(bool) => sub { 1 },
q(&{}) => "_overload_coderef",
fallback => 1,
;
BEGIN {
require Type::Tiny;
overload->import(q(~~) => sub { $_[0]->has_coercion_for_value($_[1]) })
if Type::Tiny::SUPPORT_SMARTMATCH();
}
Adding 'fallback => 1' to the ->import call fixes this. I'll send a
pull request to Type::Tiny to fix this.
--
- Twitter seems more influential [than blogs] in the 'gets reported in
the mainstream press' sense at least. - Matt McLeod
- That'd be because the content of a tweet is easier to condense down
to a mainstream media article. - Calle Dybedahl