"my" variable &foo::bar can't be in a package at - line 2, near "my sub foo::bar"
It should say ‘subroutine’, not ‘variable’. When I implemented lexi-
cal subs, I thought I caught all these, must I missed this one.
EXTCONST char PL_no_func[]
INIT("The %s function is unimplemented");
EXTCONST char PL_no_myglob[]
- INIT("\"%s\" variable %s can't be in a package");
+ INIT("\"%s\" %se %s can't be in a package");
EXTCONST char PL_no_localize_ref[]
INIT("Can't localize through a reference");
EXTCONST char PL_memory_wrap[]
(F) Lexically scoped subroutines are not yet implemented. Don't try
that yet.
+=item "my" subroutine %s can't be in a package
+
+(F) Lexically scoped subroutines aren't in a package, so it doesn't make
+sense to try to declare one with a package qualifier on the front.
+
=item "my %s" used in sort comparison
(W syntax) The package variables $a and $b are used for sort comparisons.
instead, which does return. To suppress this warning, put the exec() in
a block by itself.
+=item "state" subroutine %s can't be in a package
+
+(F) Lexically scoped subroutines aren't in a package, so it doesn't make
+sense to try to declare one with a package qualifier on the front.
+
=item "state %s" used in sort comparison
(W syntax) The package variables $a and $b are used for sort comparisons.
The lexical_subs feature is experimental at - line 2.
Missing name in "state sub" at - line 2.
########
+# NAME my sub pack::foo
+use feature 'lexical_subs', 'state';
+my sub foo::bar;
+state sub foo::bear;
+EXPECT
+The lexical_subs feature is experimental at - line 2.
+The lexical_subs feature is experimental at - line 3.
+"my" subroutine &foo::bar can't be in a package at - line 2, near "my sub foo::bar"
+"state" subroutine &foo::bear can't be in a package at - line 3, near "state sub foo::bear"
+Execution of - aborted due to compilation errors.
+########
# NAME Integer constant overloading returning undef
use overload;
BEGIN { overload::constant integer => sub {}; undef *^H }
/* PL_no_myglob is constant */
GCC_DIAG_IGNORE(-Wformat-nonliteral);
yyerror_pv(Perl_form(aTHX_ PL_no_myglob,
- PL_in_my == KEY_my ? "my" : "state", PL_tokenbuf),
+ PL_in_my == KEY_my ? "my" : "state",
+ *PL_tokenbuf == '&' ? "subroutin" : "variabl",
+ PL_tokenbuf),
UTF ? SVf_UTF8 : 0);
GCC_DIAG_RESTORE;
}