Skip to content

Commit 8cefde3

Browse files
authored
Merge pull request github#12088 from github/ginsbach/DocumentFinalAlias
document final type aliases
2 parents 7642245 + 1ec2c25 commit 8cefde3

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

docs/codeql/ql-language-reference/annotations.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ For example, to declare a module ``M`` as private, you could use:
1616
}
1717
1818
Note that some annotations act on an entity itself, whilst others act on a particular *name* for the entity:
19-
- Act on an **entity**: ``abstract``, ``cached``, ``external``, ``transient``, ``final``, ``override``, ``pragma``, ``language``,
19+
- Act on an **entity**: ``abstract``, ``cached``, ``external``, ``transient``, ``override``, ``pragma``, ``language``,
2020
and ``bindingset``
21-
- Act on a **name**: ``deprecated``, ``library``, ``private``, and ``query``
21+
- Act on a **name**: ``deprecated``, ``library``, ``private``, ``final``, and ``query``
2222

2323
For example, if you annotate an entity with ``private``, then only that particular name is
2424
private. You could still access that entity under a different name (using an :ref:`alias <aliases>`).
@@ -179,11 +179,11 @@ without ``external``, the compiler will report an error.
179179
``final``
180180
=========
181181

182-
**Available for**: |classes|, |member predicates|, |fields|
182+
**Available for**: |classes|, |type-aliases|, |member predicates|, |fields|
183183

184-
The ``final`` annotation is applied to entities that can't be overridden or extended.
185-
In other words, a final class can't act as a base type for any other types, and a final
186-
predicate or field can't be overridden in a subclass.
184+
The ``final`` annotation is applied to names that can't be overridden or extended.
185+
In other words, a final class or a final type alias can't act as a base type for any other types,
186+
and a final predicate or field can't be overridden in a subclass.
187187

188188
This is useful if you don't want subclasses to change the meaning of a particular entity.
189189

@@ -453,5 +453,6 @@ The ``bindingset`` annotation takes a comma-separated list of variables.
453453
.. |fields| replace:: :ref:`fields <fields>`
454454
.. |modules| replace:: :ref:`modules <modules>`
455455
.. |aliases| replace:: :ref:`aliases <aliases>`
456+
.. |type-aliases| replace:: :ref:`type aliases <type-aliases>`
456457
.. |algebraic datatypes| replace:: :ref:`algebraic datatypes <algebraic-datatypes>`
457458
.. |expressions| replace:: :ref:`expressions <expressions>`

docs/codeql/ql-language-reference/ql-language-specification.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ The following table summarizes the syntactic constructs which can be marked with
692692
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
693693
| ``external`` | | | | yes | | | | |
694694
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
695-
| ``final`` | yes | | yes | | | yes | | |
695+
| ``final`` | yes | | yes | | | yes | | yes |
696696
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+
697697
| ``transient`` | | | | yes | | | | |
698698
+----------------+---------+------------+-------------------+-----------------------+---------+--------+---------+---------+

0 commit comments

Comments
 (0)