diff options
author | Tony Cook <tony@develop-help.com> | 2016-01-04 10:17:22 +1100 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2016-01-21 11:49:34 +1100 |
commit | 08b3e84fbb1c493d7157c2ad8d1dec4242c965cc (patch) | |
tree | 93cfe5dfd8ca9d0af6b68d057a61b53815581a08 /t | |
parent | d15ad02e8936a558368fd0a2b425c0e184ee848e (diff) | |
download | perl-08b3e84fbb1c493d7157c2ad8d1dec4242c965cc.tar.gz |
[perl #127122] warn on unless (assignment) when syntax warnings are on
Previously the assignment was hidden by the not op wrapped around the
condition, but newCONDOP() is sufficiently flexible that it isn't
needed.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/warnings/op | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op index 89de94f4bc..8256c23c54 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -123,6 +123,17 @@ no warnings 'syntax' ; EXPECT ######## # op.c +# NAME unless with assignment as condition +use warnings 'syntax'; +1 unless $a = 1; +unless ($a = 1) { + 1; +} +EXPECT +Found = in conditional, should be == at - line 3. +Found = in conditional, should be == at - line 4. +######## +# op.c use warnings 'syntax' ; @a[3]; @a{3}; |