Skip to content

Commit

Permalink
t/op/sub.t: silence new warning
Browse files Browse the repository at this point in the history
A 7-year old test has recently started emitting this warning:

    Lexical subroutine &b masks previously declared package subroutine

because a new warning has been added to core.

It's not 100% clear to me whether the test itself was *relying* on a
package subroutine having the same name or not, but given that it was a
test which crashed rather than had well-defined "bad" behaviour", I
decided it was best to leave the test exactly as-is, and just silence
the warning.
  • Loading branch information
iabyn committed Feb 16, 2024
1 parent 75bedfb commit fec1430
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions t/op/sub.t
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,8 @@ eval '
{my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u);}
{my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u);}
{my ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u);}
# avoid "Lexical subroutine &b masks previously declared package subroutine"
no warnings "shadow";
CORE::state sub b; sub d { sub b {} sub d }
';
eval '()=%e; sub e { sub e; eval q|$x| } e;';
Expand Down

0 comments on commit fec1430

Please sign in to comment.