Re: Dialyzer fails to detect unused variables in R16B03

Shayan Pooya <[email protected]>
Newsgroups gmane.comp.lang.erlang.bugs
Message-ID <CABAubTiXo0e9Kj1djKLx9Lewq1ti2oPUG7W2Z4g7J1pRLAESOg@mail.gmail.com>
That is right. Here is a minimal code that emits a warning in R15B03 but
not in later versions:

-module(warning_test).
-export([start/0]).

start() ->
    try case recv() of
            {hello, W} -> io:format("hello");
            _ -> ok
        end
        catch K:V ->
            io:format("issue: ~p ~p", [K, V])
    end.

recv() ->
    {hello, world}.



On Wed, May 21, 2014 at 10:35 AM, Kostis Sagonas <[email protected]> wrote:

> On 05/21/2014 03:33 PM, Shayan Pooya wrote:
>
>> Hello,
>>
>> In this piece of code, dialyzer fails to detect unused variable RState:
>> https://github.com/pooya/disco/blob/dialyzer_bug/
>> master/src/disco_worker.erl#L235
>>
>> (The code should be changed to use _ instead of RState, but I left it
>> like this to report this issue).
>>
>> Erlang versions prior to R16B03 seem to correctly detect and report this
>> issue:
>> https://travis-ci.org/pooya/disco/builds/25693989
>>
>> Therefore, this seem to be an issue in dialyzer which is also present in
>> Erlang 17.0
>>
>
> This is bit of a strange report since dialyzer does not really detect
> unused variables (and never has).  It's the Erlang compiler/linter that
> does this.
>
> Kostis
> _______________________________________________
> erlang-bugs mailing list
> [email protected]
> http://erlang.org/mailman/listinfo/erlang-bugs
>

_______________________________________________
erlang-bugs mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-bugs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.