'please report this bug'

Michael McDaniel erlang@REDACTED
Tue Mar 29 01:30:48 CEST 2005


I discovered the following consistency check problem due to an incorrect assignment
I had in some real code.  I distilled down to the nonsense code below to reproduce
the problem.

~Michael

$ uname -a
Linux fangora 2.6.4-52-default #1 Wed Apr 7 02:08:30 UTC 2004 i686 i686 i386 GNU/Linux

$ erlc foo.erl
 foo: function out/1+15:
  Internal consistency check failed - please report this bug.
  Instruction: {get_tuple_element,{x,1},2,{x,2}}
  Error:       {bad_type,{needed,{tuple_element,3}},{actual,{tuple,2}}}:
 
 ./foo.erl:17: Warning: variable 'Arg' is unused
 ./foo.erl:22: Warning: variable 'Rr' is unused
 ./foo.erl:27: Warning: wrong number of arguments in format call
 ./foo.erl:33: Warning: this clause cannot match because a previous clause at
 line 25 always matches

-------------------------------------------------------------------------------
% a nonsense program to demonstrate the above Internal consistency check bug
%
-module(foo).
-author('Michael McDaniel dba Automated Systems, erlang@REDACTED').
-compile(export_all).


-record( ics, {       a = "a" ,
		      b     = 'b' ,
		      x	       = "" 
}).


  out(Arg) ->

   Tag = true ,

   R = #ics{x=233} ,
   { _, Rr} = R#ics{} ,	 %% WRONG assignment


   if Tag  ->
   [ 
     { html, io_lib:format('~s~s~n~p~n~s~n',
					[R#ics.a ,
				         R#ics.b ,
					 R#ics.x ]) }  
   ] ;

   true ->
   [ 
     { html, io_lib:format('~s~n',   [Tag])}
   ] 
   end .

%% end



More information about the erlang-questions mailing list