зеркало из https://github.com/github/codeql.git
documentation: add section no strong and weak aliases
This commit is contained in:
Родитель
3224b5c1b9
Коммит
493158a3f5
|
@ -123,4 +123,18 @@ You could give the predicate a more descriptive name as follows:
|
|||
|
||||
.. code-block:: ql
|
||||
|
||||
predicate lessThanTen = isSmall/1;
|
||||
predicate lessThanTen = isSmall/1;
|
||||
|
||||
.. _weak_strong_aliases:
|
||||
|
||||
Strong and weak aliases
|
||||
=======================
|
||||
|
||||
Every alias is either **strong** or **weak**.
|
||||
An alias is **strong** if and only if it is a :ref:`type alias <type-aliases>` with :ref:`annotation <annotations>`
|
||||
``final``.
|
||||
During :ref:`name resolution <name-resolution>`, ambiguity between **weak** aliases of the same target is allowed,
|
||||
but ambiguity between distinct **strong** aliases or entities is invalid QL.
|
||||
For the purpose of applicative instantiation of :ref:`parameterised modules <parameterized-modules>` and
|
||||
`:ref:`parameterised module signatures <parameterized-module-signatures>`, **weak** aliases of instantiation
|
||||
arguments are considered equivalent, but distinct **strong** aliases result in separate instantiations.
|
||||
|
|
Загрузка…
Ссылка в новой задаче