Dialyzer complains The test [any()] == 'false' can never evaluate to 'true' when I try to check the output of Graph.topsort/1. Apparently the typespec annotation confused it. I guess one could either change the return value to :error | {:ok, sorted_graph} or change the typespec so that Dialyzer doesn't find it problematic? Or am I doing something wrong here.
What test are you referring to here? Since topsort/1 can return a list of vertices or the boolean false Dialyzer is correct to say that you cannot get a list to equate to false.
Dialyzer complains
The test [any()] == 'false' can never evaluate to 'true'
when I try to check the output ofGraph.topsort/1
. Apparently the typespec annotation confused it. I guess one could either change the return value to:error | {:ok, sorted_graph}
or change the typespec so that Dialyzer doesn't find it problematic? Or am I doing something wrong here.