CodeQL library for C#
codeql/csharp-all 0.9.2-dev (changelog, source)
Search

Module Annotations

Import path

import csharp

Predicates

elementTypeAnnotations

Holds if the type annotations annotations apply to type type on element element.

getChild

Gets the ith child of type annotations annotations. This is used to represent structured datatypes, where the structure of the type annotation mirrors the structure of the annotated type.

getChildNullability

Gets the ith child of nullability n. Returns n if the nullability is not explicitly stored in the database, since many type annotations will have consistent nullability.

getNoFlagsNullability

Gets the nullability with no additional flags.

getNullability

Classes

AnnotatedNullability

A type with annotated nullability, ?.

NoNullability

A type that is “fully” oblivious. The type itself is oblivious and all type arguments are oblivious.

NotAnnotatedNullability

A ref type not annotated with ? in a nullable context.

Nullability

A structured type annotation representing type nullability. For example, IDictionary<string!,string?>? has nullability <!,?>?.

ObliviousNullability

A type that is “oblivious”, either because nullability is not applicable, because the code was not compiled in a nullable context, or because the C# language version is less than 8.

OutType

An annotation indicating that the parameter is out.

ReadonlyRefType

An annotation indicating that the type is a readonly reference.

RefTypeAnnotation

An annotation indicating that the variable or return is by ref.

TypeAnnotation

An annotation on a type.

TypeAnnotations

A collection of type annotations.

Datatypes