Open sandboxFocus

Method StripNullabilityAnnotation

StripNullabilityAnnotation()

Strips the nullability annotation from the current type, returning an unannotated version.

Declaration
IArrayType StripNullabilityAnnotation()
Returns
Type Description
IArrayType

A type whose IsNullable property is null, meaning the type has no nullability annotation. If the current type is a Nullable<T>, returns the underlying value type.

Remarks

Unlike ToNonNullable(), which marks reference types as non-nullable (returning a type with IsNullable set to false), this method returns an unannotated type (with IsNullable set to null).

See Also