[erlang-questions] Dialyzer and recursive types

Tobias Lindahl <>
Tue Aug 12 09:18:18 CEST 2008


[Resend since the original didn't make it to the list]

Paul Guyot wrote:
> 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?

It is a known limitation. We have not had the time to implement
recursive types yet, parametrized or not. Unfortunately, I cannot give
you a time estimate for this.

Tobias


> 
> Regards,
> 
> Paul
> 




More information about the erlang-questions mailing list