[erlang-bugs] internal error in lint_module

Xiao Jia <>
Fri Jan 17 12:44:43 CET 2014


I am writing a parse_transform module using erl_syntax_lib:mapfold,
but encountered a mysterious error message:

z.erl:none: internal error in lint_module;
crash reason: {badarg,[{erl_scan,set_attr,

File z.erl:

-compile({parse_transform, zt}).

f(_) -> z.

However, this error still occurs even if the module does nothing:


parse_transform(AST, _Options) ->
    [parse(T) || T <- AST].

parse({function, _, _, _, _} = T) ->
    case erl_syntax_lib:mapfold(fun foobar/2, something, T) of
        {T1, _} -> T1;
        _ -> T

parse(T) -> T.

foobar(T, S) -> {T, S}.

The two files are compiled as follows

$ erlc zt.erl
$ erlc -pa . z.erl

I am using Mac OS 10.9 and installed Erlang via Homebrew.  Both R16B03
and R15B03-1 give this error.
I also created a Gist on GitHub with exactly the same information
listed above.  https://gist.github.com/stfairy/8471800

Xiao Jia

More information about the erlang-bugs mailing list