<div dir="ltr">Hi list, <span style="line-height:1.5">I am new to erlang and dialyzer. I have encounter a problem when I tried to fiddle with type specifications. </span><div><span style="line-height:1.5"><br></span></div><div><span style="line-height:1.5">Say, I have two functions:</span></div><div><span style="line-height:1.5"><br></span></div><div><div>-module(t).</div><div>-export([foo/1, bar/1]).</div><div><br></div><div>-spec foo([integer()])->[integer()].</div><div>foo(Arg)-></div><div>    [I+1||I<-Arg].</div><div><br></div><div>-spec bar(atom())->[integer()].</div><div>bar(_Arg)-></div><div>    foo(_Arg).</div><div style="line-height:1.5"><br></div></div><div style="line-height:1.5">Then apply dialyzer to this module and dialyzer warns:</div><div style="line-height:1.5"><br></div><div>t.erl:8: Invalid type specification for function t:bar/1. The success typing is ([integer()]) -> [integer()]<br></div><div><br></div><div>But if I change the specification of bar to:</div><div><br></div><div><div>-spec bar([atom()])->[integer()].</div></div><div><br></div><div>dialyzer will show no warnings. My intention is to make sure the argument of bar is the same type of list as the argument of foo. </div><div><br></div><div>Is this normal? Do I miss or misunderstand something about success typing or dialyzer?</div><div><br></div></div>