[erlang-questions] Dialyzer Error: "Analysis failed with error"

David Mercer dmercer@REDACTED
Fri Jun 24 23:42:55 CEST 2011

Inspired by
http://www.erlang-factory.com/upload/presentations/347/Kostis.pdf, I decided
to give Dialyzer a go.  The first file I tried it on, however, failed with a
rather unhelpful error.  After trimming a few thousand lines, I've got it
down to the following minimal case:





-record(rec1, {f1}).

-record(rec2, {f2}).


-type rec1(T) :: #rec1{f1 :: T}.

-type rec2(T) :: #rec2{f2 :: T}.


-spec test(rec2(rec1(A))) -> A.


test(#rec2{f2 = #rec1{f1 = X}}) -> X.


The Dialyzer error is:


dialyzer: Analysis failed with error: Illegal declaration of #rec2{f2}


Can anyone explain to me what's wrong with my types and spec?  Please
advise.  Thank-you.


David Mercer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110624/10927a9b/attachment.htm>

More information about the erlang-questions mailing list