aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2017-05-17 14:08:49 +0200
committerHans Bolinder <[email protected]>2017-05-22 15:05:49 +0200
commit838dde1e27ee6a6debf74cf2370b2284f618b348 (patch)
treeea2cd053e21765311224d70d814bead2a6a07638 /lib/stdlib/src
parent8d26eb5a9ccca27f926d1ed01d11a8ac0f55cf5a (diff)
downloadotp-838dde1e27ee6a6debf74cf2370b2284f618b348.tar.gz
otp-838dde1e27ee6a6debf74cf2370b2284f618b348.tar.bz2
otp-838dde1e27ee6a6debf74cf2370b2284f618b348.zip
stdlib: Warn for bad type variables of parameterized types
The linter emits warnings about using '_' as type variable in parameterized types.
Diffstat (limited to 'lib/stdlib/src')
-rw-r--r--lib/stdlib/src/erl_parse.yrl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 2dcddeb8c2..733932e711 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -1052,6 +1052,9 @@ build_typed_attribute({atom,Aa,record},
build_typed_attribute({atom,Aa,Attr},
{type_def, {call,_,{atom,_,TypeName},Args}, Type})
when Attr =:= 'type' ; Attr =:= 'opaque' ->
+ lists:foreach(fun({var, A, '_'}) -> ret_err(A, "bad type variable");
+ (_) -> ok
+ end, Args),
case lists:all(fun({var, _, _}) -> true;
(_) -> false
end, Args) of