Closed karenetheridge closed 5 years ago
I’m pretty sure this is a warning?
I’m not to interested into figuring it out, since it seems like a special case in the test.
I don’t mind a fix though :) (And I will look into it, if it affects production code)
I think it's an exception, that is just turning into a warning because of an eval{}
somewhere, but I don't know what is causing it. I see it all the time in Mojo code; there's something about how Mojolicious constructs things that seems to tickle this somehow. I will look into it more on Monday!
Hi,
I happen to have a Mac available, so I just tried it out and reduced it to the following snippet, showing that Cpanel::JSON::XS is the cause here:
use Cpanel::JSON::XS ();
my $coder = Cpanel::JSON::XS->new;
$coder->allow_blessed->convert_blessed;
my $data = {nick => bless({}, 'BoolTestOk')};
my $json = $coder->encode($data);
package BoolTestOk;
use overload '""' => sub {1};
Happens with Cpanel::JSON::XS 4.08 and 4.09, haven't tried other versions so far.
Taking out the overload
makes it go away.
That’s awesome! Thank you @perlpunk 👍
@karenetheridge would be interesting though in which other situations you see this. This test case seems to be a rather unusual thing.
nice sleuthing!!
Upgrading to Cpanel::JSON::XS 4.10 fixes this issue.
The test "passes", but clearly has an issue in here somewhere. I am guessing an
eval{}
is swallowing it?