aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJim Fehrle2020-08-07 20:54:55 -0700
committerJim Fehrle2020-08-15 22:54:44 -0700
commit0e96c241550c4a8abf65f3bb63fcd7cab3380e92 (patch)
treede77e762756b319d049e843edb2255c1b47c4b5c /doc
parent7427e7c5fa5312e7625ebf5243978691fdb04f92 (diff)
Document semantic restriction on patterns
Diffstat (limited to 'doc')
-rw-r--r--doc/sphinx/language/core/variants.rst15
1 files changed, 11 insertions, 4 deletions
diff --git a/doc/sphinx/language/core/variants.rst b/doc/sphinx/language/core/variants.rst
index d00a2f4100..8e2bf32dd6 100644
--- a/doc/sphinx/language/core/variants.rst
+++ b/doc/sphinx/language/core/variants.rst
@@ -57,6 +57,11 @@ Private (matching) inductive types
Definition by cases: match
--------------------------
+Objects of inductive types can be destructured by a case-analysis
+construction called *pattern matching* expression. A pattern matching
+expression is used to analyze the structure of an inductive object and
+to apply specific treatments accordingly.
+
.. insertprodn term_match pattern0
.. prodn::
@@ -77,10 +82,12 @@ Definition by cases: match
| @numeral
| @string
-Objects of inductive types can be destructured by a case-analysis
-construction called *pattern matching* expression. A pattern matching
-expression is used to analyze the structure of an inductive object and
-to apply specific treatments accordingly.
+Note that the :n:`@pattern ::= @pattern10 : @term` production
+is not supported in :n:`match` patterns. Trying to use it will give this error:
+
+.. exn:: Casts are not supported in this pattern.
+ :undocumented:
+
This paragraph describes the basic form of pattern matching. See
Section :ref:`Mult-match` and Chapter :ref:`extendedpatternmatching` for the description