aardappel / lobster

The Lobster Programming Language
http://strlen.com/lobster
2.25k stars 119 forks source link

remove() does not handle references correctly #198

Closed AntonBogun closed 1 year ago

AntonBogun commented 2 years ago

The code

let l=[[1],[2]]
l.remove(0,2)
print(l)

results in a post-execution warning: LEAKS FOUND (this indicates cycles in your object graph, or a bug in Lobster) _-1_ = [2]

Note that the same applies when using strings, but not integers, which leads me to believe that this is an issue only with referenced values.

aardappel commented 2 years ago

Fixed here: https://github.com/aardappel/lobster/commit/8071024d25b265a7534ecb69dc413f99a313143a