[erlang-bugs] Fwd: Internal error in lint_module

Stavros Aronis aronisstav@REDACTED
Tue Jun 4 17:23:50 CEST 2013


Version:
------------
Erlang R16B01 [source-01eb200],

Steps to reproduce:
-----------------------------
After cloning this repository...

    git clone git://github.com/abhay/eunit.git

and running...

    make

I get a crash from the lint_module:

erlc -pa ../ebin -W -I../include +warn_unused_vars +nowarn_shadow_vars
+warn_unused_import -o../ebin eunit.erl
eunit.erl:none: internal error in lint_module;
crash reason: {function_clause,
               [{erl_lint,expr,
                 [{record_field,
                   [{line,{"eunit.erl",0}}],
                   {atom,[{line,{"eunit.erl",0}}],''},
                   {atom,[{line,{"eunit.erl",0}}],eunit}},
                  [],...

Analysis:
-------------
It is related to the deletion of a clause in erl_lint that was handling
packages:

Commit: 1c1649481025236cad29a7ee3cbd8f552757b2b6
Author: Björn Gustavsson <bjorn@REDACTED>
Date:   Mon Dec 3 14:45:10 2012 +0100

    erl_lint: Remove support for packages

@@ -2086,13 +2030,6 @@ expr({record,Line,Name,Inits}, Vt, St) ->
                  fun (Dfs, St1) ->
                          init_fields(Inits, Line, Name, Dfs, Vt, St1)
                  end);
-expr({record_field,Line,_,_}=M, _Vt, St0) ->
-    case expand_package(M, St0) of
-        {error, St1} ->
-            {[],add_error(Line, illegal_expr, St1)};
-        {_, St1} ->
-            {[], St1}
-    end;
 expr({record_field,Line,Rec,Name,Field}, Vt, St0) ->
     {Rvt,St1} = record_expr(Line, Rec, Vt, St0),
     {Fvt,St2} = check_record(Line, Name, St1,

The input module is of course legacy code and should be updated, but I
think a better error message would be nice.

Cheers,

Stavros
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130604/d80be22f/attachment.htm>


More information about the erlang-bugs mailing list