Hi!<div><br></div><div>I have confirmed this bug and I will submit a patch for it soon. Thanks for the report!</div><div><br></div><div>Stavros<br><div><br><div class="gmail_quote">On Sat, Mar 31, 2012 at 5:51 PM, Sebastian Egner <span dir="ltr"><<a href="mailto:sebastian.egner@entelios.com">sebastian.egner@entelios.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
The two modules a and b below seem to crash the Dialyzer in OTP R15B:<br>
<br>
./dialyzer --src a.erl b.erl<br>
<br>
--> Error in process <0.29.0> with exit value: {{badmatch,{c,list,[any,any],nonempty}},[{erl_types,t_abstract_records,2,[{file,"erl_types.erl"},{line,3194}]},{erl_types,'-t_abstract_records/2-lc$^1/1-5-',2,[{file,"erl_types.erl"},{line,3204}]},{erl_types,'-t_abstract_records/2-lc$^1/1-5-'...<br>
<br>
(Checking a.erl and b.erl individually is inconspicious.)<br>
<br>
For a possible workaround, see below.<br>
<br>
Sebastian<br>
<br>
<br>
*Details*<br>
<br>
Here is the reduced example:<br>
<br>
% ---------------<br>
<br>
-module(a).<br>
-export([g/1]).<br>
<br>
-export_type([a/0, t/0]).<br>
-type a() :: integer().<br>
-type t() :: a() | maybe_improper_list(t(), t()).<br>
<br>
-spec g(t()) -> t().<br>
g(X) -> X.<br>
<br>
% ---<br>
<br>
-module(b).<br>
-export([f/1]).<br>
<br>
-spec f(a:t()) -> a:t().<br>
f(X) -> a:g(X).<br>
<br>
% ---------------<br>
<br>
<br>
*Workaround*<br>
<br>
My understanding of the inner workings of Dialyzer is too limited to fix it at the quality needed to submit a patch directly through Github.<br>
<br>
However, the following patch of t_abstract_records/2 in "otp_src_R15B/lib/hipe/cerl/erl_types.erl" corrects what is probably an "accidental match" against NewContents:<br>
<br>
3194,3195c3194,3195<br>
< ?list(NewContents, NewTermination, _) = t_cons(NewContents, Other),<br>
< ?list(NewContents, NewTermination, Size)<br>
---<br>
> ?list(NewContents2, NewTermination, _) = t_cons(NewContents, Other),<br>
> ?list(NewContents2, NewTermination, Size)<br>
<br>
_______________________________________________<br>
erlang-bugs mailing list<br>
<a href="mailto:erlang-bugs@erlang.org">erlang-bugs@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-bugs" target="_blank">http://erlang.org/mailman/listinfo/erlang-bugs</a><br>
</blockquote></div><br></div></div>