[erlang-bugs] Dialyzer unmatched_returns generates false positives

Kostis Sagonas kostis@REDACTED
Tue Apr 12 18:36:52 CEST 2011


Adam Lindberg wrote:
> Ah, I see.
> 
> How come dialyzer complains about the list comprehension and not the 
> lists:foreach/2 call? Is there any difference between them that warrants 
> the warning in one case but not the other?

This is a fair question.  Dialyzer suppresses the warnings for unmatched 
returns when the return is a single *atomic* value (e.g., an atom like 
'ok' as in the lists:foreach/2 case or an integer like 42). It complains 
in all other cases (i.e., when  the return is a structured term like a 
list or a tuple or when there are multiple returns like 'ok' | 'error').

Hope this clears the issue now.

Kostis



More information about the erlang-bugs mailing list