Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Might be better for Graph.topsort/1 to return :error and {:ok, sorted_graph}? #27

Open
x-ji opened this issue Feb 21, 2019 · 1 comment

Comments

@x-ji
Copy link

x-ji commented Feb 21, 2019

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.

@stevensonmt
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants