[erlang-bugs] scarce dialyzer message "illegal declaration of..." with records

Kostis Sagonas kostis@REDACTED
Tue Nov 29 13:15:34 CET 2011


On 11/20/2011 11:56 PM, Samuel wrote:
> Hello,
>
> If you run dialyzer in the attached file it will fail with next message:
>
> Analysis failed with error: Illegal declaration of #state{parent}
>
> In the example the problem is pretty obvious, there is a mismatch
> between the declared type of the 'parent' field and the function
> specification. However in a larger example I found it very hard to
> spot. Even worse, if dialyzer is analysing a list of modules it
> wouldn't say what module caused the error. (Actually, I ran a very
> boring 'shrinking' binary process of deleting code sections until I
> found the cause of the error, which happened to be a type annotation
> generated by typer before I started refining the specs).

Thanks for reporting this issue and sending a minimal test case for it. 
  We very much appreciate it.  We have added file and line number 
information to this error and sent a patch which is included in 'pu'. 
Hopefully, it will appear in R15.

Kostis



More information about the erlang-bugs mailing list