jmitchell / backtrex

Backtracking behaviour to solve discrete problems by brute force
Other
26 stars 2 forks source link

Fix Dialyzer warnings #8

Closed jmitchell closed 7 years ago

jmitchell commented 7 years ago

Currently produces the following warnings:

lib/backtrex.ex:138: The call 'Elixir.Backtrex.Examples.Sudoku.Solver':search(@1::#{'struct':='Elixir.Backtrex.Examples.Sudoku.Puzzle', 'cells':=#{{,}=>'' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}},@6::[any()],[{{,_},map()},...]) breaks the contract ('Elixir.Backtrex':problem(),['Elixir.Backtrex':unknown()],['Elixir.Backtrex':assignmentsearch()]) -> 'Elixir.Backtrex':result() lib/backtrex.ex:160: The call 'Elixir.Backtrex.Examples.Sudoku.Solver':search(@1::#{'struct':='Elixir.Backtrex.Examples.Sudoku.Puzzle', 'cells':=#{{,}=>'' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}},@2::[any()],[{{,},map()},...]) breaks the contract ('Elixir.Backtrex':problem(),['Elixir.Backtrex':unknown()],['Elixir.Backtrex':assignmentsearch()]) -> 'Elixir.Backtrex':result() lib/backtrex.ex:187: The call 'Elixir.Backtrex.Examples.Sudoku.Solver':search(@1::#{'struct':='Elixir.Backtrex.Examples.Sudoku.Puzzle', 'cells':=#{{,}=>'' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9}},@2::[any(),...],[{{,},map()},...]) breaks the contract ('Elixir.Backtrex':problem(),['Elixir.Backtrex':unknown()],['Elixir.Backtrex':assignment_search()]) -> 'Elixir.Backtrex':result() lib/examples/sudoku/solver.ex:8: The inferred return type of unknowns/1 (#{'struct':='Elixir.Stream', 'done':='nil', 'funs':=nonempty_maybe_improperlist(), =>_}) has nothing in common with [any()], which is the expected return type for the callback of 'Elixir.Backtrex' behaviour