Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  lists:concat/1 spec inconsistent with implementation or bug

Guest
Posted: Wed Jul 21, 2010 4:10 pm Reply with quote
Guest
Hi,

When running Dialyzer on the code below I get the following messages: "The
call lists:concat([['a,...],...]) breaks the contract ([concat_thing()]) ->
string()" and "Function unused_function/1 will never be called"

Test code:

-export([parse/0]).

parse()->
concat(),
unused_function(a).

concat() ->
lists:concat([[a]]).

unused_function(A) ->
A.

The line: "lists:concat([[a]])." runs fine in the shell, but seems to cause
the dialyzer to stop, which I assume is the reason it warns that
unused_function/1 will never be used, even though it is used. If the arity
is changed to 0 and the arguments removed from the call, the warning seems
to disapear though.

Is it a bug in the lists:concat/1's spec or in Dialyzer?

Running:
openSUSE 11.0 (X86-64)
Erlang R14A (erts-5.Cool [source] [64-bit]
Dialyzer v2.3.0

Regards,
Rickard Olsson
Erlang Solutions


Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum