Skip to content

Commit e4da82a

Browse files
authored
null cannot be boxed (dotnet#5335)
The use of the term boxing is not appropriate in case of 'null'.
1 parent 15ae10e commit e4da82a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System/Nullable.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@
5454
The <xref:System.Nullable> class provides complementary support for the <xref:System.Nullable%601> structure. The <xref:System.Nullable> class supports obtaining the underlying type of a nullable type, and comparison and equality operations on pairs of nullable types whose underlying value type does not support generic comparison and equality operations.
5555
5656
## Boxing and Unboxing
57-
When a nullable type is boxed, the common language runtime automatically boxes the underlying value of the <xref:System.Nullable%601> object, not the <xref:System.Nullable%601> object itself. That is, if the <xref:System.Nullable%601.HasValue%2A> property is `true`, the contents of the <xref:System.Nullable%601.Value%2A> property is boxed. If the `HasValue` property is `false`, `null` is boxed. When the underlying value of a nullable type is unboxed, the common language runtime creates a new <xref:System.Nullable%601> structure initialized to the underlying value.
57+
When a nullable type is boxed, the common language runtime automatically boxes the underlying value of the <xref:System.Nullable%601> object, not the <xref:System.Nullable%601> object itself. That is, if the <xref:System.Nullable%601.HasValue%2A> property is `true`, the contents of the <xref:System.Nullable%601.Value%2A> property is boxed.
58+
59+
If the `HasValue` property of a nullable type is `false`, the result of the boxing operation is `null`. When the underlying value of a nullable type is unboxed, the common language runtime creates a new <xref:System.Nullable%601> structure initialized to the underlying value.
5860
5961
]]></format>
6062
</remarks>

0 commit comments

Comments
 (0)