[erlang-questions] How to force dialyzer that a function will return?

Peti Gömöri gomoripeti@REDACTED
Sat Oct 13 15:01:21 CEST 2018


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181013/cc32850a/attachment.htm>


More information about the erlang-questions mailing list