Pattern generation: improve inferred map patterns by keeping key order and retaining `_` values
Closed this issue · 0 comments
zachallaun commented
Two improvements:
- If an existing pattern is asserting key presence but ignoring it's value with
_
, the inferred pattern should also use_
- When updating an existing pattern, keep the same key order
auto_assert %{foo: 1, bar: _} <- %{foo: "NEW", bar: 2, baz: 3}
# currently defaults to
auto_assert %{bar: 2, foo: "NEW"} <- %{foo: "NEW", bar: 2, baz: 3}
# should default to
auto_assert %{foo: "NEW", bar: _} <- %{foo: "NEW", bar: 2, baz: 3}