[erlang-questions] How to force dialyzer that a function will return?
Robert Raschke
rtrlists@REDACTED
Sat Oct 13 16:57:02 CEST 2018
Hi Peti,
that dialyzer warning usually really means what it says, unfortunately
without pointing out where exactly the path is that leads to "no return".
In my experience, it is worth investigating where your code may end up with
an error that leads to a crash. And not try to silence the warning.
Cheers,
Robby
On Sat, 13 Oct 2018 15:01 Peti Gömöri, <gomoripeti@REDACTED> wrote:
> Hi,
>
> Let's say I have a function that does a bad thing, but I now it will
> actually return. I can use the `-dialyzer` module attribute to silence the
> warning about the particular function, but is there any way to convince
> dialyzer to ignore that warning and assume that the function will return
> (and consequently all other functions calling it will also return).
>
> For example for the below module dialyzer still warns:
> dt.erl:6: Function outer/0 has no local return
>
> ```
> -module(dt).
> -export([outer/0]).
>
> -dialyzer({nowarn_function, inner/0}).
>
> outer() ->
> inner().
>
> inner() ->
> Dict = dict:new(),
> element(2, Dict).
> ```
>
> (this is just an example, I dont want to decompose a dict)
>
> thanks
> Peter
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181013/471bf914/attachment.htm>
More information about the erlang-questions
mailing list