Erlang/OTP Forums

Author Message

<  Erlang bugs mailing list  ~  lint_module crash on -check_untyped_records

lordnull
Posted: Wed Mar 03, 2010 8:00 pm Reply with quote
Joined: 03 Mar 2010 Posts: 2
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:
Code:
erlc +warn_untyped_record badmod.erl


This should cause:

Code:
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{}:

Code:
-module(badmod).

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

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

[/code]
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum