Subject: | no indirect in eval can trigger for direct calls on __PACKAGE__ |
Inside a string eval, using a direct call on __PACKAGE__ will trigger indirect warnings if the package name is included anywhere in the eval text after the method call. Attached is a test case that demonstrates the issue.
Subject: | indirect-eval-bug.t |
use strict;
use warnings;
use Test::More;
use Test::Fatal;
eval <<'END_CODE';
no indirect 'fatal';
package Welp;
__PACKAGE__->can(1);
END_CODE
is $@, '', 'no exception with fatal+package name not in eval text somewhere';
eval <<'END_CODE';
no indirect 'fatal';
package Welp;
__PACKAGE__->can(1);
# Welp
END_CODE
is $@, '', 'no exception with fatal+package name in eval text somewhere';
done_testing;