aboutsummaryrefslogtreecommitdiffstats
path: root/erts/doc
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2016-11-29 09:37:21 +0100
committerHans Bolinder <[email protected]>2016-12-01 16:07:11 +0100
commit91048957f0681dba853f5720d3618aa1c5d0255e (patch)
tree6e15b3365bc2ea4b9d7042c1d023f71bb0002f2d /erts/doc
parentca29c37928ad36cf4270fb3edffc2cf9752f2ed9 (diff)
downloadotp-91048957f0681dba853f5720d3618aa1c5d0255e.tar.gz
otp-91048957f0681dba853f5720d3618aa1c5d0255e.tar.bz2
otp-91048957f0681dba853f5720d3618aa1c5d0255e.zip
stdilb: Check for bad type constraints in function types
The parser recognizes the 'is_subtype(V, T)' syntax for constraints, and of course the new 'V :: T' syntax, but other variants result in an error message. Up to now, the parser and linter have let badly formed constraints through, and relied upon Dialyzer to emit warnings. is_subtype/2 cannot easily be taken out from the parser. Not only would we need find a way to emit a (linter) warning, but there also needs to be an option for suppressing the linter warning as compilation with +warnings_as_errors has to work. (Notice that the abstract format representation for 'V :: T' is the same as for 'is_subtype(V, T)'.) This correction was triggered by an email from Robert, and Kostis created pull request 1214 to provide a fix. However, Kostis' fix disallowed is_subtype() altogether, which breaks backward compatibility. As of Erlang/OTP 19.0 (ticket OTP-11879), the 'is_subtype(V, T)' is no longer documented.
Diffstat (limited to 'erts/doc')
-rw-r--r--erts/doc/src/absform.xml2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/doc/src/absform.xml b/erts/doc/src/absform.xml
index ab00d47425..fe8e3b30e7 100644
--- a/erts/doc/src/absform.xml
+++ b/erts/doc/src/absform.xml
@@ -886,7 +886,7 @@
Rep(Fc) = <c>[Rep(C_1), ..., Rep(C_k)]</c>.</p>
<list type="bulleted">
- <item>If C is a constraint <c>is_subtype(V, T)</c> or <c>V :: T</c>,
+ <item>If C is a constraint <c>V :: T</c>,
where <c>V</c> is a type variable
and <c>T</c> is a type, then Rep(C) =
<c>{type,LINE,constraint,[{atom,LINE,is_subtype},[Rep(V),Rep(T)]]}</c>.