Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 570fa4332848e5e6d63ff907f85dd41234d6fe2c
      
https://github.com/Perl/perl5/commit/570fa4332848e5e6d63ff907f85dd41234d6fe2c
  Author: Lukas Mai <[email protected]>
  Date:   2024-08-31 (Sat, 31 Aug 2024)

  Changed paths:
    M embed.h
    M op.c
    M opcode.h
    M pod/perldiag.pod
    M proto.h
    M regen/opcodes
    M t/lib/warnings/op

  Log Message:
  -----------
  warn about !$x == $y, !$x =~ /abc/, and similar constructs

Commit 2f48e46b3f6d2d introduced a warning for logical negation as the
left operand of the `isa` operator, which likely indicates a precedence
problem (i.e. the programmer wrote `! $x isa $y` when they probably
meant `!($x isa $y)`).

This commit extends the warning to all (in)equality comparisons (`==`,
`!=`, `<`, `>`, `<=`, `>=`, `eq`, `ne`, `lt`, `gt`, `le`, `ge`) as well
as binding operations (`=~`, `!~`).

As an indication that such a warning is useful in the real world, the
core currently contains two files with (likely broken) code that
triggers this warning:

  - ./cpan/Test-Simple/lib/Test2/Hub.pm
  - ./cpan/Scalar-List-Utils/t/uniqnum.t


  Commit: ebf6b88163d9a04497e2b6a95156fe9a5e7dcadd
      
https://github.com/Perl/perl5/commit/ebf6b88163d9a04497e2b6a95156fe9a5e7dcadd
  Author: Lukas Mai <[email protected]>
  Date:   2024-08-31 (Sat, 31 Aug 2024)

  Changed paths:
    M op.c
    M t/lib/warnings/op

  Log Message:
  -----------
  don't warn about !$x == !CONSTANT (constant-folded RHS)


Compare: https://github.com/Perl/perl5/compare/869f2455070c...ebf6b88163d9

To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to