This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Name lexical constants
$ ./perl -Ilib -Mfeature=:all -e 'my sub a(){44} a()'
The lexical_subs feature is experimental at -e line 1.
Assertion failed: (hek), function Perl_ck_subr, file op.c, line 10558.
Abort trap: 6
The experimental warning is expected. The assertion failure is not.
When a call checker is invoked, the name of the subroutine is passed
to it. op.c:ck_subr gets the name from the CV’s cv (CvGV) or, in the
case of lexical subs, from its name hek (CvNAME_HEK). If neither
exists, ck_subr cannot cope.
Lexical subs never have a GV pointer. Lexical constants were acci-
dentally having neither a GV pointer nor a hek. They should have a
hek, like other lexical subs.