didn't treat appending to containers the same way for variables as well as for container lvalues. Fixes #209
This commit is contained in:
1 parent
d6d6b69fcb
commit
66e361167d
1 file changed
+10
-1
@@ -657,10 +657,19 @@ public class Expression
|
||||
throw new InternalExpressionException("Failed to resolve left hand side of the += operation");
|
||||
}
|
||||
Value key = ((LContainerValue) v1).getAddress();
|
||||
Value res = cvi.get(key).add(v2);
|
||||
Value value = cvi.get(key);
|
||||
if (value instanceof ListValue || value instanceof MapValue)
|
||||
{
|
||||
((AbstractListValue) value).append(v2);
|
||||
return (cc, tt) -> value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Value res = value.add(v2);
|
||||
cvi.put(key, res);
|
||||
return (cc, tt) -> res;
|
||||
}
|
||||
}
|
||||
v1.assertAssignable();
|
||||
String varname = v1.getVariable();
|
||||
LazyValue boundedLHS;
|
||||
|
||||
Reference in new issue
Block a user