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
Shouldn't Perl warn about «my $foo => "bar" || "baz";» ? #16792
Comments
From @dod38frCreated by @dod38frHello Shouldn't the following 2 lines issue a warning ? $ perl -w -E 'my $foo => "bar" // "baz";' The second part of the statement is useless. A similar line without // $ perl -w -E 'my $foo => "bar" ;' I'd think Perl should be able to warn in the 2 first cases. All the best Perl Info
|
From @jkeenanOn Sat, 22 Dec 2018 15:47:18 GMT, domi.dumont@free.fr wrote:
I'm inclined to agree, particularly as using the lower-precedence 'or' operator instead of '||' throws a warning: ##### -- |
The RT System itself - Status changed from 'new' to 'open' |
From @iabynOn Sat, Dec 22, 2018 at 04:53:25PM -0800, James E Keenan via RT wrote:
I think its intentional. This is intended *not* to warn: perl -we'use constant SILENT => 1; SILENT || print' When the LHS of || is a compile-time true value, the RHS part of the -- |
Migrated from rt.perl.org#133735 (status was 'open')
Searchable as RT133735$
The text was updated successfully, but these errors were encountered: