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

WW kingwang98@REDACTED
Sun Apr 28 22:38:13 CEST 2019


Why dialyzer did not complain when  I  exported the function validator/1 ?
It means exported function allowing never reach the calls ?

   On Sunday, April 28, 2019, 9:30:03 PM GMT+2, Kostis Sagonas <kostis@REDACTED> wrote:  
 
 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
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190428/0ba04e06/attachment.htm>


More information about the erlang-questions mailing list