Wrong spec for parse_file?
bortzmeyer opened this issue · 1 comments
bortzmeyer commented
The documentation says that parse_file
can return {:ok, …}
or {:error, [Exception.t]}
. But, apparently, parse_file
can also return {:error, atom}
:
iex(2)> TomlElixir.parse_file("doesnotexist")
{:error, :enoent}
Because of this erroneous spec, Dialyzer complains when I use TOML:
lib/drink/toml.ex:10:pattern_match
The pattern can never match the type.
Pattern:
{:error, :enoent}
Type:
{:error, %{:__exception__ => true, :__struct__ => atom(), atom() => _}}
________________________________________________________________________________
As seen above parse_file
can return {:error, :enoent}
.
bitwalker commented
This is the :toml
library, not :toml_elixir