Skip to content

Commit 0dc7123

Browse files
committed
documentation for type signature members
1 parent 471a596 commit 0dc7123

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ Type signatures
4040
===============
4141

4242
Type signatures declare module parameters that will be substituted with types when the module is instantiated.
43-
Type signatures are used to specify supertypes and are the simplest category of signatures.
43+
Type signatures may specify supertypes and required member predicates (in addition to those member predicates that are
44+
implied by the supertypes).
4445

4546
The substitution of type signatures relies on structural typing. That is, types do not have to be explicitly defined as
46-
implementing a type signature - they just need to have the specified (transitive) supertypes.
47+
implementing a type signature - they just need to have the specified (transitive) supertypes and member predicates.
4748

4849
In detail, a type signature definition consists of:
4950

@@ -52,14 +53,19 @@ In detail, a type signature definition consists of:
5253
#. The name of the type signature. This is an `identifier <https://codeql.github.com/docs/ql-language-reference/ql-language-specification/#identifiers>`_
5354
starting with a uppercase letter.
5455
#. Optionally, the keyword ``extends`` followed by a list of types, separated by commas.
55-
#. A semicolon ``;``.
56+
#. Either a semicolon ``;`` or a list of predicate signatures enclosed in braces.
57+
The ``signature`` keyword is omitted for these contained signatures.
5658

5759
For example:
5860

5961
.. code-block:: ql
6062
6163
signature class ExtendsInt extends int;
6264
65+
signature class CanBePrinted {
66+
string toString();
67+
}
68+
6369
Module signatures
6470
=================
6571

0 commit comments

Comments
 (0)