aboutsummaryrefslogtreecommitdiff
path: root/doc/sphinx/language/core
diff options
context:
space:
mode:
authorThéo Zimmermann2020-05-14 10:42:07 +0200
committerThéo Zimmermann2020-05-14 10:42:07 +0200
commit0867c1d11264b39d00f117da29cbb9d1fa1f911d (patch)
tree939a2620cc5fc59a27ce66a6776c0e1427fa715f /doc/sphinx/language/core
parentb67f58dbc0b1e723e75b79e375804a06c23d2e7f (diff)
Add type casts to new Definitions file.
Diffstat (limited to 'doc/sphinx/language/core')
-rw-r--r--doc/sphinx/language/core/definitions.rst24
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/sphinx/language/core/definitions.rst b/doc/sphinx/language/core/definitions.rst
new file mode 100644
index 0000000000..ba48ea130d
--- /dev/null
+++ b/doc/sphinx/language/core/definitions.rst
@@ -0,0 +1,24 @@
+.. index::
+ single: ... : ... (type cast)
+ single: ... <: ...
+ single: ... <<: ...
+
+Type cast
+---------
+
+.. insertprodn term_cast term_cast
+
+.. prodn::
+ term_cast ::= @term10 <: @term
+ | @term10 <<: @term
+ | @term10 : @term
+ | @term10 :>
+
+The expression :n:`@term : @type` is a type cast expression. It enforces
+the type of :n:`@term` to be :n:`@type`.
+
+:n:`@term <: @type` locally sets up the virtual machine for checking that
+:n:`@term` has type :n:`@type`.
+
+:n:`@term <<: @type` uses native compilation for checking that :n:`@term`
+has type :n:`@type`.