[erlang-questions] Dialyzer and recursive types

Paul Guyot <>
Sun Aug 10 09:07:33 CEST 2008


Hello,

I'm trying to use dialyzer with a recursive type and I get an error  
when using the tree type defined in the slides:

----
-module(dialyzer_bug).
-export([foo/0]).
-type(tree(X) :: {X,tree(X),tree(X)} | nil).
-spec(foo/0 :: () -> tree(integer())).
foo() -> nil.
----
   Checking whether the PLT /Users/paul/.dialyzer_plt is up-to- 
date... yes
   Proceeding with analysis...
Analysis failed with error: Could not scan the following file(s): [{"/ 
Users/paul/tmp/dialyzer_bug.beam",
                                          
[85,110,107,110,111,119,110,32,116,
                                          121,112,101,32,"tree",10]}]
Last messages in log cache: ["Reading files and computing  
callgraph... "]

dialyzer: Internal problems were encountered in the analysis.
----

The same error occurs even if the type is not parametrized.

----
-module(dialyzer_bug).
-export([foo/0]).
-type(tree() :: {integer(),tree(),tree()} | nil).
-spec(foo/0 :: () -> tree()).
foo() -> nil.
----

Is it a known bug? Or is it a mistake in the way I specify the  
recursive type?

Regards,

Paul




More information about the erlang-questions mailing list