[erlang-questions] Erlang dialyzer warnings for internal functions.

Kostis Sagonas kostis@REDACTED
Sun Apr 28 21:32:04 CEST 2019


On 4/28/19 6:41 PM, WW wrote:
> 
> What is the best solution to avoid dialyzer warnings meanwhile also 
> satisfy my use cases.?
> 

One cannot really answer this question without knowing what your "use 
case(s)" really is.,,,

If it really is the code example you posted, if you pay close attention 
to the warning that you get from dialyzer, dialyzer also tells you that 
the call validator([]), let alone validator(3), is actually unreachable 
code in your example.  This is because dialyzer discovers that the prior 
call (validator(undefined)) will throw an exit exception and 
control-flow will never reach the validator([]) (and validator(3)) calls.

Once again, remember the slogan: "Dialyzer is never wrong."

Kostis



More information about the erlang-questions mailing list