From 08b3e84fbb1c493d7157c2ad8d1dec4242c965cc Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Mon, 4 Jan 2016 10:17:22 +1100 Subject: [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. --- t/lib/warnings/op | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 't') 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}; -- cgit v1.2.1