[erlang-patches] dialyzer: Report specs defining 'incorrect' lists as return types

Stavros Aronis aronisstav@REDACTED
Mon Dec 17 11:09:46 CET 2012


Hi Fredrik,

Running the tests on my branch (which is rebased on maint) does not yield
any errors.

Running the tests on master-pu, I get a different error.

By manually running the test I can see that the error that you report comes
from what I would guess is the new extension that reports column numbers
along file lines.

Has this patch graduated on master? What is the suggested course of action?

Regards,

Stavros


On Mon, Dec 17, 2012 at 10:22 AM, Fredrik <fredrik@REDACTED> wrote:

>  Hello Stavros!
> This fails:
> 'small_SUITE : empty_list_infimum'
> with reason:
> dialyzer:format_warning failed on line 295 Reason: function_clause
> On all platforms..
> Please fix this, and I will re-fetch.
>
>
> BR Fredrik Gustafsson
> Erlang OTP Team
> On 12/14/2012 10:11 AM, Stavros Aronis wrote:
>
> This patch enables Dialyzer to detect cases where a function has a
> specification for a return type containing some list with elements
> different than those Dialyzer's own algorithm can infer e.g. a function
> specified to return [atom()] when actually [[atom()]] is returned.
>
>  Previously Dialyzer remained silent under normal operation, seeing that
> these two types have the empty list as a common element, so the spec was
> not 'completely irrelevant'.
>
>  Using this patch one can find discrepancies in the specs of
> stdlib's sys.erl and erl_scan.erl. Kostis and I are in contact with the OTP
> team for the best way fix those as well.
>
>    git fetch git://github.com/aronisstav/otp.git dialyzer-list-spec
>
>  Regards,
>
>  Stavros
>
>  ---
>
>  The new warnings are:
>
>  sys.erl:303: Invalid type specification for function sys:handle_debug/4.
> The success typing is ([{_,_}],_,_,_) -> [{_,_}]
>   erl_scan.erl:204: Invalid type specification for function
> erl_scan:token_info/2. The success typing is (_,'category' | 'column' |
> 'length' | 'line' | 'location' | 'symbol' | 'text' |
> maybe_improper_list('category' | 'column' | 'length' | 'line' | 'location'
> | 'symbol' | 'text','category' | 'column' | 'length' | 'line' | 'location'
> | 'symbol' | 'text' | [])) -> 'undefined' |
> maybe_improper_list({_,_},'undefined' | [] | {_,_}) | {_,_}
> erl_scan.erl:242: Invalid type specification for function
> erl_scan:attributes_info/2. The success typing is (_,'column' | 'length' |
> 'line' | 'location' | 'text' | maybe_improper_list('column' | 'length' |
> 'line' | 'location' | 'text','column' | 'length' | 'line' | 'location' |
> 'text' | [])) -> 'undefined' | maybe_improper_list({_,_},'undefined' | [] |
> {_,_}) | {_,_}
>
>
>
>
> _______________________________________________
> erlang-patches mailing listerlang-patches@REDACTED://erlang.org/mailman/listinfo/erlang-patches
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-patches/attachments/20121217/6427c9f9/attachment.htm>


More information about the erlang-patches mailing list