Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/stdlib/src/erl_lint.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5278,7 +5278,7 @@ check_record_info_call(_Anno,_Aa,[{atom,Ai,Info},{atom,_An,Name}], St) ->
true ->
case St#lint.records of
#{Name := {_,tuple,_}} ->
St;
used_record(Name, St);
#{} ->
add_error(Ai, native_record_illegal_record_info, St)
end;
Expand Down
13 changes: 11 additions & 2 deletions lib/stdlib/test/erl_lint_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5695,9 +5695,10 @@ illegal_zip_generator(Config) ->

ok.

%% GH-9694. Only record_info/2 should be checked for illegal_record_info
record_info_0(Config) ->
Ts = [{record_info_0,
Ts = [%% GH-9694. Only record_info/2 should be checked for
%% illegal_record_info
{record_info_0,
<<"-export([f/0]).
record_info() -> ok.
f() -> record_info().
Expand All @@ -5710,6 +5711,14 @@ record_info_0(Config) ->
g() -> record_info(ok).
">>,
[],
[]},
%% ERIERL-1345: record_info/2 should mark tuple records as used
{record_info_2,
<<"-export([h/0]).
-record(rec,{a,b,c}).
h() -> record_info(fields, rec).
">>,
[],
[]}
],
[] = run(Config, Ts),
Expand Down
Loading