diff options
author | Anthony Ramine <[email protected]> | 2013-07-31 10:31:51 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-08-27 16:15:21 +0200 |
commit | 92460f4035e369be8726c88a72055d0fd6c7cdfe (patch) | |
tree | e6d413e13ba3ddf5b5baf42e1d79105b8dbdc92c /lib/stdlib/src | |
parent | 9ce148b1059e4da746a11f1d80a653340216c468 (diff) | |
download | otp-92460f4035e369be8726c88a72055d0fd6c7cdfe.tar.gz otp-92460f4035e369be8726c88a72055d0fd6c7cdfe.tar.bz2 otp-92460f4035e369be8726c88a72055d0fd6c7cdfe.zip |
Fix variable usage tracking in some record errors
When reporting a field redefinition in a record, erl_lint can forget
about some old unused variables.
f() -> X = 1, #r{a=foo,a=bar,a=qux}.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r-- | lib/stdlib/src/erl_lint.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl index 708ef44fed..f599881c07 100644 --- a/lib/stdlib/src/erl_lint.erl +++ b/lib/stdlib/src/erl_lint.erl @@ -2308,7 +2308,7 @@ check_fields(Fs, Name, Fields, Vt, St0, CheckFun) -> check_field({record_field,Lf,{atom,La,F},Val}, Name, Fields, Vt, St, Sfs, CheckFun) -> case member(F, Sfs) of - true -> {Sfs,{Vt,add_error(Lf, {redefine_field,Name,F}, St)}}; + true -> {Sfs,{[],add_error(Lf, {redefine_field,Name,F}, St)}}; false -> {[F|Sfs], case find_field(F, Fields) of |