Diaylzer in R14A with opaque types

Thorsten Schuett <>
Wed Jul 7 16:50:32 CEST 2010


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.




-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) ->

More information about the erlang-bugs mailing list