mirror of
https://github.com/github/codeql.git
synced 2026-05-02 04:05:14 +02:00
documentation for type signature members
This commit is contained in:
@@ -40,10 +40,11 @@ Type signatures
|
||||
===============
|
||||
|
||||
Type signatures declare module parameters that will be substituted with types when the module is instantiated.
|
||||
Type signatures are used to specify supertypes and are the simplest category of signatures.
|
||||
Type signatures may specify supertypes and required member predicates (in addition to those member predicates that are
|
||||
implied by the supertypes).
|
||||
|
||||
The substitution of type signatures relies on structural typing. That is, types do not have to be explicitly defined as
|
||||
implementing a type signature - they just need to have the specified (transitive) supertypes.
|
||||
implementing a type signature - they just need to have the specified (transitive) supertypes and member predicates.
|
||||
|
||||
In detail, a type signature definition consists of:
|
||||
|
||||
@@ -52,7 +53,8 @@ In detail, a type signature definition consists of:
|
||||
#. The name of the type signature. This is an `identifier <https://codeql.github.com/docs/ql-language-reference/ql-language-specification/#identifiers>`_
|
||||
starting with a uppercase letter.
|
||||
#. Optionally, the keyword ``extends`` followed by a list of types, separated by commas.
|
||||
#. A semicolon ``;``.
|
||||
#. Either a semicolon ``;`` or a list of predicate signatures enclosed in braces.
|
||||
The ``signature`` keyword is omitted for these contained signatures.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -60,6 +62,10 @@ For example:
|
||||
|
||||
signature class ExtendsInt extends int;
|
||||
|
||||
signature class CanBePrinted {
|
||||
string toString();
|
||||
}
|
||||
|
||||
Module signatures
|
||||
=================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user