This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
for CORE::my $var (...) {} is legal syntax, hence test it
authorNicholas Clark <nick@ccl4.org>
Mon, 18 Oct 2021 13:16:40 +0000 (13:16 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 18 Oct 2021 14:10:14 +0000 (14:10 +0000)
commit65b7cc064468ea58fd900e8293dfb0fdd1de8092
treedb55e6f20c0811591807c920d072635a092d9f5d
parent7b1885ae53fad4123864416d9ef0bbdb78a1882f
for CORE::my $var (...) {} is legal syntax, hence test it

We had tests for CORE::state, but not CORE::my or CORE::our. It happens that
they are all legal syntax, but seemingly more be accident than design. They
are only accepted by yyl_foreach() as a quirk of the current implementation.

Note that for my Dog $spot (...) {} is legal, but not CORE::my. our Dog is
legal, CORE::our is not. Neither state Dog nor CORE::state are legal. These
are all emergent behaviour of the parser - do not take these tests as
"correct", merely as verifying that current behaviour doesn't change unless
we intended it to.
t/op/for.t