aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/stdlib/src/erl_lint.erl10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index db98c7020c..4c0261a1ad 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2337,7 +2337,7 @@ is_valid_map_key_value(K) ->
Tag =:= map_field_exact ->
B andalso is_valid_map_key_value(Ke)
andalso is_valid_map_key_value(Ve)
- end, true, Ps);
+ end,true,Ps);
{map,_,Ps} ->
foldl(fun
({Tag,_,Ke,Ve},B) when Tag =:= map_field_assoc;
@@ -2345,13 +2345,19 @@ is_valid_map_key_value(K) ->
B andalso is_valid_map_key_value(Ke)
andalso is_valid_map_key_value(Ve)
end, true, Ps);
+ {record,_,_,Fs} ->
+ foldl(fun
+ ({record_field,_,Ke,Ve},B) ->
+ B andalso is_valid_map_key_value(Ke)
+ andalso is_valid_map_key_value(Ve)
+ end,true,Fs);
{bin,_,Es} ->
% only check for value expressions to be valid
% invalid binary expressions are later checked in
% core and kernel
foldl(fun
({bin_element,_,E,_,_},B) ->
- B andalso is_valid_map_key_value(E)
+ B andalso is_valid_map_key_value(E)
end,true,Es);
_ -> false
end.