elixir-temp
elixir-temp copied to clipboard
Align `Temp.open!/2`'s spec with it's implementation
When calling Temp.open! with i.e. Temp.open!(%{basedir: "/tmp", suffix: "foo-"}, &IO.write(&1, "")) Dialyzer warns:
The call 'Elixir.Temp':'open!'
(#{'basedir' := binary(), 'suffix' := binary()},
fun((_) -> 'ok')) breaks the contract
(options(), pid() | 'nil') ->
'Elixir.Path':t() |
{'Elixir.File':io_device(), 'Elixir.Path':t()} |
no_return()
The @spec seems to be outdated. Temp.open!/2 internally calls Temp.open/2 with the same arguments, so the specs for both function's arguments should match.