Skip to content

Commit 493158a

Browse files
committed
documentation: add section no strong and weak aliases
1 parent 3224b5c commit 493158a

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,18 @@ You could give the predicate a more descriptive name as follows:
123123

124124
.. code-block:: ql
125125
126-
predicate lessThanTen = isSmall/1;
126+
predicate lessThanTen = isSmall/1;
127+
128+
.. _weak_strong_aliases:
129+
130+
Strong and weak aliases
131+
=======================
132+
133+
Every alias is either **strong** or **weak**.
134+
An alias is **strong** if and only if it is a :ref:`type alias <type-aliases>` with :ref:`annotation <annotations>`
135+
``final``.
136+
During :ref:`name resolution <name-resolution>`, ambiguity between **weak** aliases of the same target is allowed,
137+
but ambiguity between distinct **strong** aliases or entities is invalid QL.
138+
For the purpose of applicative instantiation of :ref:`parameterised modules <parameterized-modules>` and
139+
`:ref:`parameterised module signatures <parameterized-module-signatures>`, **weak** aliases of instantiation
140+
arguments are considered equivalent, but distinct **strong** aliases result in separate instantiations.

0 commit comments

Comments
 (0)