"Constant subroutine %"SVf" undefined",
SVfARG(CvANON((const CV *)sv)
? newSVpvs_flags("(anonymous)", SVs_TEMP)
- : sv_2mortal(newSVhek(GvENAME_HEK(CvGV((const CV *)sv))))));
+ : sv_2mortal(newSVhek(
+ CvNAMED(sv)
+ ? CvNAME_HEK((CV *)sv)
+ : GvENAME_HEK(CvGV((const CV *)sv))
+ ))
+ ));
/* FALLTHROUGH */
case SVt_PVFM:
{
*bar::like = *like;
}
no warnings 'deprecated';
-plan 135;
+plan 136;
# -------------------- Errors with feature disabled -------------------- #
),
qr/Deep recursion on subroutine "foo"/,
'deep recursion warnings for lexical subs do not crash';
+
+like runperl(
+ switches => [ '-Mfeature=:all', '-Mwarnings=FATAL,all', '-M-warnings=experimental::lexical_subs' ],
+ prog => 'my sub foo() { 42 } undef &foo',
+ stderr => 1
+ ),
+ qr/Constant subroutine foo undefined at /,
+ 'constant undefinition warnings for lexical subs do not crash';