diff --git a/standard/classes.md b/standard/classes.md index 2d212974c..47dd24262 100644 --- a/standard/classes.md +++ b/standard/classes.md @@ -442,10 +442,11 @@ The nullability of the type argument need not match the nullability of the type > *Note*: To specify that a type argument is a nullable reference type, don’t add the nullable type annotation as a constraint (use `T : class` or `T : BaseClass`), but use `T?` throughout the generic declaration to indicate the corresponding nullable reference type for the type argument. *end note* - -The nullable type annotation, `?`, can’t be used on an unconstrained type argument. + +The nullable type annotation, `?`, can only be used on a type parameter that has the value type constraint, the reference type constraint without the *nullable_type_annotation*, or a class type constraint without the *nullable_type_annotation*. -For a type parameter `T` when the type argument is a nullable reference type `C?`, instances of `T?` are interpreted as `C?`, not `C??`. + + > *Example*: The following examples show how the nullability of a type argument impacts the nullability of a declaration of its type parameter: > diff --git a/standard/types.md b/standard/types.md index 31ccd4773..10d906541 100644 --- a/standard/types.md +++ b/standard/types.md @@ -27,7 +27,7 @@ For convenience, throughout this specification, some library type names are writ ### 8.2.1 General -A reference type is a class type, an interface type, an array type, a delegate type, or the `dynamic` type. For each non-nullable reference type, there is a corresponding nullable reference type noted by appending the `?` to the type name. +A reference type is a class type, an interface type, an array type, a delegate type, the `dynamic` type, or any type parameter that is constrained to be a reference type (that is, any type parameter with the reference type constraint or a class type constraint ([§15.2.5](classes.md#1525-type-parameter-constraints))). For each non-nullable reference type, there is a corresponding nullable reference type noted by appending the `?` to the type name. ```ANTLR reference_type