diff --git a/lslopt/lslparse.py b/lslopt/lslparse.py index 057c4eb..4bf6124 100644 --- a/lslopt/lslparse.py +++ b/lslopt/lslparse.py @@ -1128,10 +1128,10 @@ list lazy_list_set(list L, integer i, list v) if self.explicitcast: if ltype == 'list' != rtype: rexpr = {'nt':'CAST', 't':ltype, 'ch':[rexpr]} - #rtype = ltype # unused elif rtype == 'list' != ltype: term = {'nt':'CAST', 't':rtype, 'ch':[term]} - ltype = rtype + if rtype == 'list': + ltype = rtype term = {'nt':op, 't':ltype, 'ch':[term, rexpr]} # Note that although list + nonlist is semantically the same as # list + (list)nonlist and same goes for nonlist + list, they diff --git a/testparser.py b/testparser.py index 949cca9..a632b7f 100644 --- a/testparser.py +++ b/testparser.py @@ -270,7 +270,7 @@ class Test03_Optimizer(UnitTestCase): integer j = 3||4&&5|6^7&8.==9!=10.e+01f<11<=12>13.>=14<<15>>16==0&&3== ++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0; integer k = 2 + (3 * 25 - 4)/2 % 9; - a = (list)3; a += !3; + a = (list)3; a += !3; a = 3+a; f += 4; f += -4.3; integer i; i = llGetListLength(L);