Closed maciej-sz closed 10 years ago
Thanks. Back port of logic from HAMT+ introduced this bug in V0.1.5 but no tests caught it. Should be fixed now:
var updateCollisionList = \h list f k -> {
var target, i = 0;
for (var len = list.length; i < len; i = i + 1)
with child = list.(i) in {
if (child.key === k) {
target = child;
break;
}
}
return let v = ?target : f(target.value) : f() in
?isNothing v
:arraySpliceOut(i, list)
:arrayUpdate(i, new Leaf(h, k, v), list);
};
To my understanding
Collision.children
should contain only instances ofLeaf
. But theupdateCollisionList
function inserts to that array raw output of thef
(in two places) which results inchildren
containing raw values.This sometimes causes
undefined property
(child.key
) error while invokingCollision.lookup
: