Hacker News new | ask | show | jobs
by sabiwara 7 days ago
> Does Dialyzer understand Elixir? Last I knew, it could only process Erlang source code and BEAM files.

Once compiled, it boils down to BEAM files that Dialyzer can understand, yes. And the [Dialyxir](https://dialyxir.hexdocs.pm) wrapper helps translating error messages in Elixir. But, there is a significant limitation compared to plain Erlang: Elixir protocols (which are quite used in core parts of the language) are not an Erlang construct, so Dialyzer will be clueless about them, just accepting any term. Enum.map(nil, & &foo/1) or to_string(%{}) will be invisible to it.

1 comments

Ah. So I assume that Dialyxir does some sort of patch-up or correlation or enrichment or whatever you want to call it between the results dialyzer pulls out of BEAM files and the Elixir-specific type-and-other-metadata that Dialyxir has access to?

That sounds complicated, but so's Dialyzer. Hopefully the Dialyxir people are having a fine time working on it.