I quite like the idea of more compilation-warnings for impossible pattern matches! However, it does seem like a lot of work will be needed to get them reliable and performant enough to get there and I don't have any insight to add there.
But I do want to point out that the "Map matching on struct specific keys" isn't an impossible match since not all structs are well-formed, e.g. the "range" function head can be hit like so:
```
iex(1)> defmodule MapVsStruct do
...(1)> def key_match(%{first: _first}), do: "map"
...(1)> def key_match(%Range{}), do: "range"
...(1)> end
{:module, MapVsStruct,
<<70, 79, 82, 49, 0, 0, 5, 188, 66, 69, 65, 77, 65, 116, 85, 56, 0, 0, 0, 209,
0, 0, 0, 20, 18, 69, 108, 105, 120, 105, 114, 46, 77, 97, 112, 86, 115, 83,
116, 114, 117, 99, 116, 8, 95, 95, 105, ...>>, {:key_match, 1}}
iex(2)> MapVsStruct.key_match(%{__struct__: Range})
"range"
```
So given that I'm not sure we'd want a compilation warning for that pattern match, so perhaps that warning would make more sense in a linter like Credo.
-Jason