develooper Front page | perl.perl5.porters | Postings from June 2016

[perl #107604] anonymous sub with attribute in void parse context isambiguous, should warn

Thread Previous
From:
=?UTF-8?B?T2xpdmllciBNZW5ndcOp?= via RT
Date:
June 28, 2016 09:20
Subject:
[perl #107604] anonymous sub with attribute in void parse context isambiguous, should warn
Message ID:
rt-4.0.18-2025-1467105608-413.107604-15-0@perl.org
Le Jeu 05 Jan 2012 06:12:10, zefram@fysh.org a écrit :
> Olivier Mengu?? wrote:
> >Workaround: force non-void parse context with '+':
> >
> >$ perl -MO=Deparse -e '+sub : lvalue { die; my $a }'
> >BEGIN { $^W = 1; }
> >sub : lvalue {
> 
> Here's an actual bug: B::Deparse's output suffers the unintended
> interpretation.  B::Deparse needs to be taught the workaround.

I notice the B::Deparse bug is fixed in perl 5.24.0.

    $ perl -MO=Deparse -e '+sub :lvalue { die; my $a }'
    +sub : lvalue {
        die;
        my $a;
    }
    ;
    -e syntax OK


I would be interested to see the commit that fixed that.




---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=107604

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About