lint_module crash on +check_untyped_records

Micah Warren micahw@REDACTED
Thu Mar 4 17:09:39 CET 2010


Attempting to compile a module that defines a type dependant on an undefined record with the +warn_untyped_record flag causes erl_lint to crash with reason badarg. Perhaps a better behavior is to report the undefined record instead. 

This has been tested on R13B03 on OS 10.6.2. 

To reproduce the behavior: 

Create the file badmod.erl: 

Code:

-module(badmod). 

-type(test() :: #arec{}).


Compile: 
erlc +warn_untyped_record badmod.erl


This should cause: 

badmod.erl:none: internal error in lint_module; 
crash reason: {badarg,[{dict,fetch, 
                             [arec, 
                              {dict,0,16,16,8,80,48, 
                                    {[],[],[],[],[],[],[],[],[],[],[],[],[], 
                                     [],[],[]}, 
                                    {{[],[],[],[],[],[],[],[],[],[],[],[],[], 
                                      [],[],[]}}}]}, 
                       {erl_lint,'-check_untyped_records/2-fun-1-',3}, 
                       {lists,foldl,3}, 
                       {erl_lint,post_traversal_check,2}, 
                       {erl_lint,module,3}, 
                       {compile,lint_module,1}, 
                       {compile,'-internal_comp/4-anonymous-1-',2}, 
                       {compile,fold_comp,3}]} 


To resolve the error define #arec{}: 

-module(badmod). 

-record(arc, {id :: string()}). 

-type(test() :: #arec{}).



More information about the erlang-bugs mailing list