|
|
| Author |
Message |
|
| Guest |
Posted: Wed Jul 07, 2010 2:51 pm |
|
|
|
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 |
|
|
| Back to top |
|
| Guest |
Posted: Mon Jul 12, 2010 9:59 pm |
|
|
|
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 |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
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
|
|
|