You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original reporter: sparr
Affected version: OTP-18.0
Fixed in version: OTP-18.3
Component: stdlib
Migrated from: https://bugs.erlang.org/browse/ERL-62
If erl_lint:module is called on a set of forms that has a -deprecated line but no -module line then it ends up trying to call is_builtin with an empty list for the Module parameter, and that doesn't go so well.
test case:
{code:erlang}
-module(erl_bug).
-export([test/0,test/1]).
test() ->
test("-module(bug_test). t()->1. t()->2."),
test("-module(bug_test). -deprecated([{frutt,0,next_version}])."),
test("-deprecated([{frutt,0,next_version}]).").
test(S) ->
file:write_file("bug_test.erl",S),
{ok, Forms} = epp:parse_file("bug_test.erl",[]),
{error, Errors, _} = erl_lint:module(Forms, "bug_test.erl"),
[{_,[{_,Mod,Err}]}] = Errors,
io:fwrite("~p~n",[Err]),
io:fwrite("~s~n",[Mod:format_error(Err)]).
{code}
result:
{code:erlang}
> erl_bug:test().
{redefine_function,{t,0}}
function t/0 already defined
{bad_deprecated,{frutt,0}}
deprecated function frutt/0 undefined or not exported
** exception error: bad argument
in function erlang:is_builtin/3
called as erlang:is_builtin([],frutt,0)
in call from erl_lint:depr_fa/4 (erl_lint.erl, line 1000)
in call from erl_lint:'-check_deprecated/2-lc$^1/1-1-'/5 (erl_lint.erl, line 971)
in call from erl_lint:check_deprecated/2 (erl_lint.erl, line 969)
in call from erl_lint:post_traversal_check/2 (erl_lint.erl, line 842)
in call from erl_lint:module/2 (erl_lint.erl, line 485)
in call from erl_bug:test/1 (erl_bug.erl, line 12)
{code}
The text was updated successfully, but these errors were encountered:
Original reporter:
sparr
Affected version:
OTP-18.0
Fixed in version:
OTP-18.3
Component:
stdlib
Migrated from: https://bugs.erlang.org/browse/ERL-62
The text was updated successfully, but these errors were encountered: