From ea5b38935a17af38a328c8013e7eaf3c8de7ba09 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 5 Sep 2017 13:15:30 +0100 Subject: 41641: Some math operations shouldn't be lvalues. This includes pre- and post- increment and decrement. Simply mark all values after operations as rvalues. --- Test/C01arith.ztst | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Test/C01arith.ztst') diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst index 61da763ac..30409adf3 100644 --- a/Test/C01arith.ztst +++ b/Test/C01arith.ztst @@ -420,3 +420,16 @@ 0:type of variable when created in arithmetic context >integer >scalar + + integer a=1 + print $(( ++a * 2 )) + print $(( ++a )) + print $(( a++ * 2 )) + print $(( a )) + print $(( ++a++ * 2 )) +1: Allow rvalue but not lvalue operations with result of increment +>4 +>3 +>6 +>4 +?(eval):6: bad math expression: lvalue required -- cgit 1.4.1