<div dir="ltr">Answering my own mail here, because Anthony Ramine had the correct answer: erlang:nif_error/1 gets special treatment in the dialyzer and avoids this problem. I'll reflect that in my code.<div><br></div><div>The other problem is that the OTP can't reproduce the error on a fresh 17.4 install. Is it possible for someone to test it. It may be my installation that is broken beyond repair.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 1:55 AM, Jesper Louis Andersen <span dir="ltr"><<a href="mailto:jesper.louis.andersen@gmail.com" target="_blank">jesper.louis.andersen@gmail.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 1:46 AM, Kostis Sagonas <span dir="ltr"><<a href="mailto:kostis@cs.ntua.gr" target="_blank">kostis@cs.ntua.gr</a>></span> wrote:</div><div class="gmail_quote"><br></div><div class="gmail_quote">I indeed see as to why this is true:</div><span class=""><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thus, the -spec box_keypair() -> #{ atom() => binary() }. that you have specified is wrong as far as Dialyzer is concerned.</blockquote></div><br></span>But how do you propose I fix this problem then? not_loaded() will *never* be called in a real program since it will be replaced by the NIFs C code. I want that code to crash and burn if it is ever called, because it means the NIF is not loaded properly. That is, what is the correct specification to give here such that the underlying call to enacl_nif:crypto_box_keypair() returns the right type, without getting the dialyzer all confused due to the replacement code in the erlang module?<span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div>J.</div>
</font></span></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div class="gmail_signature">J.</div>
</div>