Hello, <div><br></div><div>I've been trying to make 'dialyzer' work for mongodb-erlang [*] and found out that the following line seems to crash 'dialyzer':</div><div><br></div><div> <font face="'courier new', monospace">src/mongo_replset.erl:-opaque rs_connection() :: {rs_connection, rs_name(), mvar:mvar(connections()), timeout()}.</font><br>
</div><div><br></div><div>Traceback:</div><div><br></div><div><div> <font face="'courier new', monospace"> $ dialyzer ebin/{mongo_replset,mvar}.beam</font></div><div><font face="'courier new', monospace"> Checking whether the PLT /Users/bobry/.dialyzer_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"> =ERROR REPORT==== 12-Mar-2012::09:51:34 ===</font></div><div><font face="'courier new', monospace"> Error in process <0.29.0> with exit value: {function_clause,[{erl_types,t_contains_opaque,[{c,remote,[{remote,mvar,mvar,[{c,remote,[{remote,dict,dictionary,[{c,remote,[{remote,mongo_connect,host,[]}],unknown},{c,tuple_set,[{0,[{c,tuple,[],{0,any}}]},{1,[{c... </font></div>
<div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace"><br></font></div><div><font face="'courier new', monospace"> dialyzer: Analysis failed with error:</font></div>
<div><font face="'courier new', monospace"> {function_clause,[{erl_types,t_contains_opaque,</font></div><div><font face="'courier new', monospace"> [{c,remote,[{...}],unknown}],</font></div>
<div><font face="'courier new', monospace"> [{file,"erl_types.erl"},{line,473}]},</font></div><div><font face="'courier new', monospace"> {lists,all,2,[{file,[...]},{line,...}]},</font></div>
<div><font face="'courier new', monospace"> {dialyzer_dataflow,get_apply_fail_msg,9,[{file,...},{...}]},</font></div><div><font face="'courier new', monospace"> {dialyzer_dataflow,handle_apply_or_call,8,[{...}|...]},</font></div>
<div><font face="'courier new', monospace"> {dialyzer_dataflow,handle_let,3,[...]},</font></div><div><font face="'courier new', monospace"> {dialyzer_dataflow,do_clause,6,...},</font></div>
<div><font face="'courier new', monospace"> {dialyzer_dataflow,handle_clauses,...},</font></div><div><font face="'courier new', monospace"> {dialyzer_dataflow,...}]}</font></div>
<div><font face="'courier new', monospace"> Last messages in the log cache:</font></div><div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,close,1}]</font></div><div>
<font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,connect,1}]</font></div><div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,connect_member,2}]</font></div>
<div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,fetch_member_info,1}]</font></div><div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,primary_conn,3}]</font></div>
<div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,primary,1}]</font></div><div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,secondary_ok_conn,2}]</font></div>
<div><font face="'courier new', monospace"> Typesig analysis for SCC: [{mongo_replset,secondary_ok,1}]</font></div><div><font face="'courier new', monospace"> Dataflow of one SCC: [mvar]</font></div>
<div><font face="'courier new', monospace"> Dataflow of one SCC: [mongo_replset]</font></div></div><div><br></div><div>Simply replacing '-opaque' with '-type' helps, but I'm not sure if it's invalid typing in mongodb-erlang which causes the issue, or is it a bug in 'dialyzer'?</div>
<div><br></div><div>Sergei</div><div><br></div><div>[*] <a href="https://github.com/mongodb/mongodb-erlang">https://github.com/mongodb/mongodb-erlang</a></div>