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
no warning for my $a = 1 if 0; #11252
Comments
From @nwc10Created by @nwc10$ ./perl -we 'my $a if 0' Presumably the latter should warn too. (not a regression) Nicholas Clark Perl Info
|
From @doyPushed a fix for this to doy/false_conditional, but this is triggering if (FALSE_CONSTANT and my $foo = $bar) { which doesn't seem to be a useful thing to warn for. Unfortunately, it |
The RT System itself - Status changed from 'new' to 'open' |
From @ikegamiOn Sun, Jun 24, 2012 at 5:56 AM, Jesse Luehrs via RT <
There's a scope around "if" statements that limit the visibility of It seems to me that if that is fixed, the optree would become |
From @davidnicolis there a risk of wrecking old code that uses the C<my (...) if 0> state hack? |
From @ikegamiOn Mon, Jun 25, 2012 at 7:58 PM, David Nicol <davidnicol@gmail.com> wrote:
I suggested a change to the "if" statement only, not the "if" statement |
From @nwc10On Sun, Jun 24, 2012 at 02:56:55AM -0700, Jesse Luehrs via RT wrote:
I don't think that it deserves to be deprecated. The scoping is different. $ perl -we 'use strict; my $c = 1 if 0; print $c' Whereas 0 and my $c = 1 doesn't create $c outside of the eliminated block. $ perl -we 'use strict; if (0 and my $c = 1) {}; print $c' op.h has this: /* Private for OP_CONST */ Is OPpCONST_SHORTCIRCUIT true on the constant? Nicholas Clark |
From @doyOn Thu, Jun 28, 2012 at 12:20:19PM +0100, Nicholas Clark wrote:
I agree, which is why I didn't merge the branch.
It's actually true in both cases - the same part of the code that does | expr IF expr -doy |
From @doyOn Thu, Jun 28, 2012 at 01:35:14PM -0500, Jesse Luehrs wrote:
It does strike me though that we could just differentiate there -doy |
From @doyOn Thu, Jun 28, 2012 at 01:40:29PM -0500, Jesse Luehrs wrote:
So I tried this (and updated the branch), but this still isn't quite -doy |
From @cpansproutOn Thu Jun 28 14:32:27 2012, doy@tozt.net wrote:
I know more about this now than before implementing lexical subs, so I The mexpr and texpr rules in perly.y are probably where you want to set -- Father Chrysostomos |
From @cpansproutOn Mon Sep 24 00:06:59 2012, sprout wrote:
Actually, that won’t help, as it will be too late. -- Father Chrysostomos |
Migrated from rt.perl.org#88384 (status was 'open')
Searchable as RT88384$
The text was updated successfully, but these errors were encountered: