mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-03 00:18:20 +00:00
nonlist + list was returning the type of the nonlist element. Fixed and added a
regression test. Funnily enough, it was correct if explicit cast was active. Removed from explicit cast now that it's active for all.
This commit is contained in:
parent
aa74e6ed64
commit
d8649deebd
2 changed files with 3 additions and 3 deletions
|
@ -1128,9 +1128,9 @@ list lazy_list_set(list L, integer i, list v)
|
||||||
if self.explicitcast:
|
if self.explicitcast:
|
||||||
if ltype == 'list' != rtype:
|
if ltype == 'list' != rtype:
|
||||||
rexpr = {'nt':'CAST', 't':ltype, 'ch':[rexpr]}
|
rexpr = {'nt':'CAST', 't':ltype, 'ch':[rexpr]}
|
||||||
#rtype = ltype # unused
|
|
||||||
elif rtype == 'list' != ltype:
|
elif rtype == 'list' != ltype:
|
||||||
term = {'nt':'CAST', 't':rtype, 'ch':[term]}
|
term = {'nt':'CAST', 't':rtype, 'ch':[term]}
|
||||||
|
if rtype == 'list':
|
||||||
ltype = rtype
|
ltype = rtype
|
||||||
term = {'nt':op, 't':ltype, 'ch':[term, rexpr]}
|
term = {'nt':op, 't':ltype, 'ch':[term, rexpr]}
|
||||||
# Note that although list + nonlist is semantically the same as
|
# Note that although list + nonlist is semantically the same as
|
||||||
|
|
|
@ -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==
|
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;
|
++f-f++-(3 + llFloor(f)<<3 << 32) - 2 - 0;
|
||||||
integer k = 2 + (3 * 25 - 4)/2 % 9;
|
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;
|
f += 4; f += -4.3;
|
||||||
integer i;
|
integer i;
|
||||||
i = llGetListLength(L);
|
i = llGetListLength(L);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue