aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/erl_parse.yrl
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2014-04-09 13:04:36 +0200
committerHans Bolinder <[email protected]>2014-04-29 09:17:01 +0200
commit8943276198034c6500ecbf4e513886ccf80fa056 (patch)
tree0d235c514ba52f937caaf62627788de46e2fd558 /lib/stdlib/src/erl_parse.yrl
parent4f0b3948eae361c04a3ed565a475a5d38f3c876d (diff)
downloadotp-8943276198034c6500ecbf4e513886ccf80fa056.tar.gz
otp-8943276198034c6500ecbf4e513886ccf80fa056.tar.bz2
otp-8943276198034c6500ecbf4e513886ccf80fa056.zip
Disallow '_' as type variable
"... when _ :: ..." used to compile, but Dialyzer crashed.
Diffstat (limited to 'lib/stdlib/src/erl_parse.yrl')
-rw-r--r--lib/stdlib/src/erl_parse.yrl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 3bb7a90c4f..8601c89d59 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -664,6 +664,8 @@ find_arity_from_specs([Spec|_]) ->
{type, _, 'fun', [{type, _, product, Args},_]} = Fun,
length(Args).
+build_def({var, L, '_'}, _Types) ->
+ ret_err(L, "bad type variable");
build_def(LHS, Types) ->
IsSubType = {atom, ?line(LHS), is_subtype},
{type, ?line(LHS), constraint, [IsSubType, [LHS, Types]]}.