Skip to content

Commit f66c0b6

Browse files
authored
Update classes.md
1 parent aa1d94b commit f66c0b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

standard/classes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ Each *type_parameter_constraints_clause* consists of the token `where`, followed
433433

434434
The list of constraints given in a `where` clause can include any of the following components, in this order: a single primary constraint, one or more secondary constraints, and the constructor constraint, `new()`.
435435

436-
A primary constraint can be a class type, the ***reference type constraint*** `class`, the ***nullable reference type constraint*** `class?`, or the ***value type constraint*** `struct`. A secondary constraint can be a *type_parameter* or *interface_type*.
436+
A primary constraint can be a class type, the ***reference type constraint*** `class`, the ***nullable reference type constraint*** `class?`, or the ***value type constraint*** `struct`. A secondary constraint can be a *type_parameter* or *interface_type*, either optionally followed by `?`.
437437

438438
If the nullable annotation context (§Nullable-Annotation-Context) is disabled, the reference type constraint specifies that a type argument used for the type parameter shall be a reference type. All class types, interface types, delegate types, array types, and type parameters known to be a reference type (as defined below) satisfy this constraint. If the nullable annotation context is enabled, the type argument used for the type parameter shall be a non-nullable reference type (§Nullable-Types).
439439

@@ -606,7 +606,7 @@ The ***effective interface set*** of a type parameter `T` is defined as follows
606606
- If `T` has no *interface_type* constraints but has *type_parameter* constraints, its effective interface set is the union of the effective interface sets of its *type_parameter* constraints.
607607
- If `T` has both *interface_type* constraints and *type_parameter* constraints, its effective interface set is the union of the set of dynamic erasures of its *interface_type* constraints and the effective interface sets of its *type_parameter* constraints.
608608
609-
A type parameter is *known to be a reference type* if it has the reference type constraint or its effective base class is not `object` or `System.ValueType`.
609+
A type parameter is *known to be a reference type* if it has the reference type constraint or the nullable reference type constraint, or its effective base class is not `object` or `System.ValueType`.
610610
611611
Values of a constrained type parameter type can be used to access the instance members implied by the constraints.
612612

0 commit comments

Comments
 (0)