<div dir="ltr"><div>One way which helps is when you know a function may not return is to declare it of type no_return() which tells dialyzer that you know this function may generate an error. It at least works for functions which explicitly call erlang:error/1.<br><br></div>Robert<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 9 December 2014 at 18:30, Jay Nelson <span dir="ltr"><<a href="mailto:jay@duomark.com" target="_blank">jay@duomark.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
On Dec 8, 2014, at 6:44 PM, Robert Virding <<a href="mailto:rvirding@gmail.com">rvirding@gmail.com</a>> wrote:<br>
<br>
> I have run into the same problem but I don't think there is anything you can do about it. Dialyzer is quite rightly informing you that you have a type error in your code, it is just unfortunate that that is what you are trying to test.<br>
><br>
> Why are you checking your test suites?<br>
><br>
> Robert<br>
<br>
<br>
<br>
</span>I am dialyzing the test suites because I found that a quick and easy way to<br>
fix simple typos and have had type errors in the past which weren’t readily<br>
apparent just by compiling and running code. I may change that decision if<br>
it creates more false positives than help for true positives.<br>
<br>
> Original example case:<br>
<span class="">> true = try ?TM:reserve(atom_to_list(Cache_Name), Cache_Module)<br>
> catch error:function_clause -> true<br>
</span>> j end,<br>
<br>
In this case I am using try/catch on a single expression which returns a value<br>
of a different type from my exact match. For some reason I expected dialyzer<br>
to handle this case since the return of the catch is a successful match against<br>
the value and I mentally assumed the try/catch was one expression.<br>
<div class="HOEnZb"><div class="h5"><br>
jay<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></div></blockquote></div></div>