<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">On Fri, Apr 2, 2021 at 3:10 PM Thomas Depierre <<a href="mailto:depierre.thomas@gmail.com">depierre.thomas@gmail.com</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>I understand the other possible "no_return" warnings here, but i do not understand what situations does "only_normal" and "both" means here and how they get differentiated. I tried to understand how Dialyzer get to this decision in the code before that, but i got bogged down.</div><div><br></div></div></blockquote><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">In general, we are trying to detect how we return from the function, but  the analysis of dialyzer has figured out that we can't possibly return from the function in any valid way. There are four cases:</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">'no_match' - we are in trouble because no clauses will ever match (because of the analysis)</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">'no_explicit' - we can only terminate by means of an explicit exception, the normal code flow will never return</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">'no_normal' - the common case. We don't have any of the two above cases, but we still know that the function won't return ever.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">'both' - we don't know if it's either no_explicit or no_normal. This occurs because we find a function call M:F(A...) where one of M or F isn't a literal (where literal refers to the Core Erlang notion of a literal value). So we kind of throw the arms in the air and go "it can be both of them, I don't know which, I give up!"</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">It might be interesting to discriminate between the two error cases and report them slightly differently in the output. My guess, and this is just a hunch, is that 'both' is a rare occurrence, and you aren't any wiser by discriminating between the two cases.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><br></div></div></div>