Closed tcoopman closed 3 weeks ago
If a map has a key that is a struct or a map you can't remove the contents, because it's not the same key anymore. If you write something like this:
struct
map
auto_assert %{%MyStruct{a: 1} => true}
mneme will propose %{%MyStruct{} => true} which is not the same.
%{%MyStruct{} => true}
And then you get output like:
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── - auto_assert %{%DomainModelling.BlockId{} => true} <- %{ - %DomainModelling.BlockId{page: 0, block: 0} => true - } ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── + auto_assert %{%DomainModelling.BlockId{} => true} <- + %{ + %DomainModelling.BlockId{page: 0, block: 0} => true + } ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Thanks for the report! The pattern generator already tracks whether it's in a map-key context, so this should be an easy fix.
If a map has a key that is a
struct
or amap
you can't remove the contents, because it's not the same key anymore. If you write something like this:mneme will propose
%{%MyStruct{} => true}
which is not the same.And then you get output like: