Open
Description
Hello!
When an expression involves remove
or removeAt
and the same base array is involved in another expression the resulti is wrong and looks like the remove function performed mutation on its parameter.
using std.remove
local a = [0,1,2,3];
std.remove(a,0)+a
returns
[ 1, 2, 3, 1, 2, 3, 3]
while I expect the result to be [ 1, 2, 3, 0, 1, 2, 3 ]
using std.removeAt
local a = ['quux','foo','bar'];
std.removeAt(a,0)+a
returns [ "foo", "bar", "foo", "bar", "bar" ]
where I expect [ "foo", "bar", "quux", "foo", "bar" ]
cpp-jsonnet seems not to be affected by this issue and it looks like it doesn't happen if the removed element is the last of the array
This happens on released version 0.21 (the others didn't have remove/removeAt)
Metadata
Metadata
Assignees
Labels
No labels