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

Stavros Aronis aronisstav@REDACTED
Mon Dec 17 11:21:01 CET 2012


Btw,

the different error I get on master-pu comes from a very weird error on
mnesia:

On mnesia.erl, line 2739 there is a call to missing function
mnesia:get_activity_id/0.

This function was removed in commit
6f4c3d127e33d59ac87a3c3b600f7a7280c9674a, part of the patch that removes
unused mnemosyne code.

Regards,


On Mon, Dec 17, 2012 at 11:09 AM, Stavros Aronis <aronisstav@REDACTED>wrote:

> 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/39b16470/attachment.htm>


More information about the erlang-patches mailing list