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
+12
-3
@@ -657,9 +657,18 @@ public class Expression
|
|||||||
throw new InternalExpressionException("Failed to resolve left hand side of the += operation");
|
throw new InternalExpressionException("Failed to resolve left hand side of the += operation");
|
||||||
}
|
}
|
||||||
Value key = ((LContainerValue) v1).getAddress();
|
Value key = ((LContainerValue) v1).getAddress();
|
||||||
Value res = cvi.get(key).add(v2);
|
Value value = cvi.get(key);
|
||||||
cvi.put(key, res);
|
if (value instanceof ListValue || value instanceof MapValue)
|
||||||
return (cc, tt) -> res;
|
{
|
||||||
|
((AbstractListValue) value).append(v2);
|
||||||
|
return (cc, tt) -> value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Value res = value.add(v2);
|
||||||
|
cvi.put(key, res);
|
||||||
|
return (cc, tt) -> res;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
v1.assertAssignable();
|
v1.assertAssignable();
|
||||||
String varname = v1.getVariable();
|
String varname = v1.getVariable();
|
||||||
|
|||||||
Reference in new issue
Block a user