Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  Diaylzer in R14A with opaque types

Guest
Posted: Wed Jul 07, 2010 2:51 pm Reply with quote
Guest
Hi,

when I run dialyzer of R14A on the attached code, it complains about the
new_neighborhood/1 function:
nodelist.erl:12: Invalid type specification for function
nodelist:new_neighborhood/1. The success typing is (_) -> {[any(),...]}

However, when I change the type nodelist() from opaque to non-opaque (see
comment), dialyzer accepts the code. The types seem to be correct. The problem
seems to be with nested opaque types.

Thorsten

-module(nodelist).

-export([new_neighborhood/1]).

-export_type([nodelist/0, neighborhood/0]).

-type(node_type() :: node_type).

-opaque(nodelist() :: [node_type()]). % change to -type
-opaque(neighborhood() :: {nodelist()}).

-spec new_neighborhood(Node::node_type()) -> neighborhood().
new_neighborhood(Node) ->
{[Node]}.

________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org

Post received from mailinglist
Guest
Posted: Mon Jul 12, 2010 9:59 pm Reply with quote
Guest
Thorsten Schuett wrote:
> Hi,
>
> when I run dialyzer of R14A on the attached code, it complains about the
> new_neighborhood/1 function:
> nodelist.erl:12: Invalid type specification for function
> nodelist:new_neighborhood/1. The success typing is (_) -> {[any(),...]}
>
> However, when I change the type nodelist() from opaque to non-opaque (see
> comment), dialyzer accepts the code. The types seem to be correct. The problem
> seems to be with nested opaque types.

Indeed. Thanks for reporting this!

The problem has been fixed (thanks to Maria Christakis) and the fix will
appear in R14B and on github soon.

Kostis


________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org

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