New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
anonymous sub with attribute in void parse context is ambiguous, should warn #11847
Comments
From @dolmenCreated by dolmen@cpan.orgAn anonymous sub with an attribute is parsed correctly by perl, but not in $ perl -we 'sub : lvalue { die; my $a }' Verified with perl 5.14.2 and 5.10.1. The problem is that in this void parse context, "sub :" is parsed as a label perl -MO=Deparse -e 'sub : lvalue { die; my $a }' Workaround: force non-void parse context with '+': $ perl -MO=Deparse -e '+sub : lvalue { die; my $a }' The case of evaluating an anonymous sub/closure in a void parse context is a As this is a case that is ambiguous in the Perl grammar but still Olivier Mengué (dolmen) Perl Info
|
From zefram@fysh.orgOlivier Mengu?? wrote:
Here's an actual bug: B::Deparse's output suffers the unintended -zefram |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Thu Jan 05 05:56:43 2012, dolmen wrote:
I wouldn’t be opposed to that, but I think it needs to wait till after 5.16. -- Father Chrysostomos |
From @dolmenLe Jeu 05 Jan 2012 06:12:10, zefram@fysh.org a écrit :
I notice the B::Deparse bug is fixed in perl 5.24.0. $ perl -MO=Deparse -e '+sub :lvalue { die; my $a }' I would be interested to see the commit that fixed that. |
From @cpansproutOn Tue Jun 28 02:20:08 2016, dolmen wrote:
v5.21.5-218-g6b6b21d -- Father Chrysostomos |
Migrated from rt.perl.org#107604 (status was 'open')
Searchable as RT107604$
The text was updated successfully, but these errors were encountered: