<div dir="ltr">Hi,<div><br></div><div>I'm trying to use dialyzer to remove a few typing bugs from neotoma (<a href="http://github.com/seancribbs/neotoma/tree/dialyzer">github.com/seancribbs/neotoma/tree/dialyzer</a>) so that generated parsers will not contain them. However, I've hit a wall and need some help, I'm hoping someone here will be able to interpret these better than me (see also <a href="https://gist.github.com/seancribbs/8210317">https://gist.github.com/seancribbs/8210317</a>):</div>
<div><br></div><div><div><font face="courier new, monospace"> Checking whether the PLT neotoma.plt is up-to-date... yes</font></div><div><font face="courier new, monospace"> Proceeding with analysis...</font></div><div>
<font face="courier new, monospace">peg_includes.hrl:85: The created fun has no local return</font></div><div><font face="courier new, monospace">peg_includes.hrl:86: Fun application will fail since P :: none() is not a function of arity 2</font></div>
<div><font face="courier new, monospace">peg_includes.hrl:201: The created fun has no local return</font></div><div><font face="courier new, monospace">neotoma.erl:52: Guard test not(is_atom(ModName::atom())) can never succeed</font></div>
<div><font face="courier new, monospace">neotoma.erl:124: Function bootstrap/0 has no local return</font></div><div><font face="courier new, monospace"> done in 0m2.41s</font></div><div><font face="courier new, monospace">done (warnings were emitted)</font></div>
</div><div><br></div><div><font face="courier new, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">The weird thing is, the variable P on peg_includes.hrl:86 is a known type, but something is causing it to think the type cannot be resolved.</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Here's the function in question (the positive lookahead combinator):</font></div><div><font face="arial, helvetica, sans-serif"><br>
</font></div><div><div><font face="courier new, monospace">-spec p_assert(parse_fun()) -> parse_fun().</font></div><div><font face="courier new, monospace">p_assert(P) -></font></div><div><font face="courier new, monospace"> fun(Input,Index) -></font></div>
<div><font face="courier new, monospace"> case P(Input,Index) of</font></div><div><font face="courier new, monospace"> {fail,_} = Failure-> Failure;</font></div><div><font face="courier new, monospace"> _ -> {[], Input, Index}</font></div>
<div><font face="courier new, monospace"> end</font></div><div><font face="courier new, monospace"> end.</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div></div><div style="font-family:arial,helvetica,sans-serif">
Interestingly, that combinator is not called by anything in the parser in question (a separate issue to be resolved).</div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><font face="arial, helvetica, sans-serif">Thanks in advance,</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Sean Cribbs</font></div></div>