Skip to content

Commit 50f35bf

Browse files
committed
Merge branch 'maint'
* maint: erl_lint: Mark records used in record_info/2 as used
2 parents d210b9d + 5a7fffc commit 50f35bf

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

lib/stdlib/src/erl_lint.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5357,7 +5357,7 @@ check_record_info_call(_Anno,_Aa,[{atom,Ai,Info},{atom,_An,Name}], St) ->
53575357
true ->
53585358
case St#lint.records of
53595359
#{Name := {_,tuple,_}} ->
5360-
St;
5360+
used_record(Name, St);
53615361
#{} ->
53625362
add_error(Ai, native_record_illegal_record_info, St)
53635363
end;

lib/stdlib/test/erl_lint_SUITE.erl

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5650,9 +5650,10 @@ illegal_zip_generator(Config) ->
56505650

56515651
ok.
56525652

5653-
%% GH-9694. Only record_info/2 should be checked for illegal_record_info
56545653
record_info_0(Config) ->
5655-
Ts = [{record_info_0,
5654+
Ts = [%% GH-9694. Only record_info/2 should be checked for
5655+
%% illegal_record_info
5656+
{record_info_0,
56565657
<<"-export([f/0]).
56575658
record_info() -> ok.
56585659
f() -> record_info().
@@ -5665,6 +5666,14 @@ record_info_0(Config) ->
56655666
g() -> record_info(ok).
56665667
">>,
56675668
[],
5669+
[]},
5670+
%% ERIERL-1345: record_info/2 should mark tuple records as used
5671+
{record_info_2,
5672+
<<"-export([h/0]).
5673+
-record(rec,{a,b,c}).
5674+
h() -> record_info(fields, rec).
5675+
">>,
5676+
[],
56685677
[]}
56695678
],
56705679
[] = run(Config, Ts),

0 commit comments

Comments
 (0)