Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/codeql/ql-language-reference/annotations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ own body, or they must inherit from another class that overrides ``isSource``:
// doesn't need to override `isSource`, because it inherits it from ConfigA
}

.. index:: additional
.. _additional:

``additional``
==============

**Available for**: |classes|, |algebraic datatypes|, |type unions|, |non-member predicates|, |modules|, |aliases|, |signatures|

The ``additional`` annotation can be used on declarations directly inside of modules that implement |module signatures|.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does directly in declarations directly inside of modules mean here? I assume it relates to nested modules.

Can't we simplify it to something along the lines of:

The `additional` annotation can be used on declarations in modules. All declarations in modules with |module signatures| that are not required by a module signature must be annotated with `additional`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does directly in declarations directly inside of modules mean here? I assume it relates to nested modules.

Yes.

What does directly in declarations directly inside of modules mean here? I assume it relates to nested modules.

Can't we simplify it to something along the lines of:

The `additional` annotation can be used on declarations in modules. All declarations in modules with |module signatures| that are not required by a module signature must be annotated with `additional`.

I've pushed another commit. I didn't take your wording directly, because I want to keep "modules that implement module signatures" rather than "modules with module signatures" to avoid ambiguity with modules that contain a module signature declaration.

All declarations in such modules that are not required by a module signature must be annotated with ``additional``.

Omitting ``additional`` on such declarations, or using the annotation in any other context, will result in a compiler error.
Other than that, the annotation has no effect.

.. index:: cached
.. _cached:

Expand Down Expand Up @@ -495,3 +509,4 @@ The ``bindingset`` annotation takes a comma-separated list of variables.
.. |signatures| replace:: :ref:`signatures <signatures>`
.. |predicate signatures| replace:: :ref:`predicate signatures <predicate-signatures>`
.. |type signatures| replace:: :ref:`type signatures <type-signatures>`
.. |module signatures| replace:: :ref:`module signatures <module-signatures>`