Subject: | respect_overload breaks in absence of stringification operator |
When option respect_overload is ON, when encountering an object that
has _some_ overloaded operators but _not_ the stringification operator,
then an exception is generated.
In such cases, Devel::StackTrace should just fallback to the default
stringification (overload::StrVal), instead of raising an exception.
Here is a short example :
package Foo;
use overload '&{}' => sub { "fake coderef" };
sub new {my $class = shift; bless {}, $class }
package main;
use Devel::StackTrace;
bar(Foo->new());
sub bar {
my $foo = shift;
my $st = Devel::StackTrace->new(no_refs => 1, respect_overload => 1);
print $st->as_string;
}
========================
Operation """": no method found, argument in overloaded package Foo at
d:/Perl/site/lib/Devel/StackTrace.pm line 139.