aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_lint.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2015-02-16 21:53:54 +0100
committerAnthony Ramine <[email protected]>2015-02-16 21:53:54 +0100
commit250f4c0453f038f9014705eed966d6c9cb186a1a (patch)
tree24ce98094334b92df6ac783a7fb1087d51c5f829 /lib/stdlib/src/erl_lint.erl
parent4f7edc376ee61238699f68c8721ab23ee56eafee (diff)
downloadotp-250f4c0453f038f9014705eed966d6c9cb186a1a.tar.gz
otp-250f4c0453f038f9014705eed966d6c9cb186a1a.tar.bz2
otp-250f4c0453f038f9014705eed966d6c9cb186a1a.zip
Properly lint map expressions in erl_lint
The returned variable table when linting a map expression shouldn't include variables that didn't appear in the expression. Reported-By: Alexei Sholik
Diffstat (limited to 'lib/stdlib/src/erl_lint.erl')
-rw-r--r--lib/stdlib/src/erl_lint.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 26d8454731..8bebedf54f 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2288,8 +2288,8 @@ map_fields([{Tag,_,K,V}|Fs], Vt, St, F) when Tag =:= map_field_assoc;
{Pvt,St2} = F([K,V], Vt, St),
{Vts,St3} = map_fields(Fs, Vt, St2, F),
{vtupdate(Pvt, Vts),St3};
-map_fields([], Vt, St, _) ->
- {Vt,St}.
+map_fields([], _, St, _) ->
+ {[],St}.
%% warn_invalid_record(Line, Record, State0) -> State
%% Adds warning if the record is invalid.