zachallaun/mneme

Bug: Multiple non-serializable values generate using same var

zachallaun opened this issue · 0 comments

# example 1: causes a crash
auto_assert [make_ref(), make_ref()]
# generates
auto_assert [ref, ref] when is_reference(ref) and is_reference(ref) <- [make_ref(), make_ref()]
# should generate
auto_assert [ref, ref1] when is_reference(ref) and is_reference(ref1) <- [make_ref(), make_ref()]

# example 2: no crash but redundant
auto_assert [self(), self()]
# generates
auto_assert [pid, pid] when is_pid(pid) and is_pid(pid) <- [self(), self()]
# should generate
auto_assert [pid, pid] when is_pid(pid) <- [self(), self()]

I think this means we need to change how we map over expressions to be something more similar to a reduce, where introduced bindings are available to patterns that come later.