Image.replace_color dialyzer issue
tielur opened this issue · 5 comments
tielur commented
I'm getting a dialyzer issue with Image.replace_color
lib/replace_with_test.ex:15:no_return
Function hello/0 has no local return.
________________________________________________________________________________
lib/replace_with_test.ex:18:call
The function call will not succeed.
Image.replace_color(%Vix.Vips.Image{:ref => reference()}, [{:replace_with, :white}])
breaks the contract
(Vix.Vips.Image.t(), Image.Options.ChromaKey.chroma_key_options() | map() | :replace_with) ::
{:ok, Vix.Vips.Image.t()} | {:error, error_message()}
tielur commented
I wrote a small example app that the above output is from:
https://github.com/tielur/replace_with_test
If you run mix dialyzer
you'll see that output
kipcole9 commented
Thanks for the report and the test case, very much appreciated. I've pushed a commit to fix the spec. Would you mind checking on your side using {:image, github: "elixir-image/image"}
in your mix.exs
to confirm before I publish an update?
tielur commented
Hey @kipcole9
It looks like Image.replace_color
is fixed but not the bang version Image.replace_color!
kipcole9 commented
Fixed! Sorry about that. Should be good now.
tielur commented
Thanks for the quick fix, both are good now!