bitwalker / libgraph

A graph data structure library for Elixir projects
MIT License
524 stars 75 forks source link

Fix Graph.topsort/1 spec #57

Closed stevegolton closed 1 year ago

stevegolton commented 1 year ago

Added false as an optional return value from Graph.topsort/1. Fixes dialyzer issues which arise when using the function.

E.g. The following code snippet:

case Graph.sort(g) do
  false -> ...
  verts -> ...
end

Generates the following dialyzer error:

file.ex:line:pattern_match
The pattern can never match the type.

Pattern:
false

Type:
[any()]