Skip to content

Commit 5ff05c9

Browse files
MichaelJLiuBillWagner
authored andcommitted
Fix incorrect remarks for Nullable<T>.Implicit operator (#2711)
* Fix incorrect remarks for Nullable<T>.Implicit operator The implicit operator's value parameter is of type T (not T?) and will never be null. * Note that C# and VB don't use the implicit Nullable operator
1 parent 0d48f00 commit 5ff05c9

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

xml/System/Nullable`1.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,17 @@
536536
<format type="text/markdown"><![CDATA[
537537
538538
## Remarks
539-
If the `value` parameter is not `null`, the <xref:System.Nullable%601.Value%2A> property of the new <xref:System.Nullable%601> value is initialized to the `value` parameter and the <xref:System.Nullable%601.HasValue%2A> property is initialized to `true`.
540-
541-
If the `value` parameter is `null`, the <xref:System.Nullable%601.Value%2A> property of the new <xref:System.Nullable%601> value is initialized to the default value, which is the value that is all binary zeroes, and the <xref:System.Nullable%601.HasValue%2A> property is initialized to `false`.
542-
543-
The equivalent method for this operator is <xref:System.Nullable%601.%23ctor%28%600%29?displayProperty=nameWithType>]]></format>
539+
The <xref:System.Nullable%601.Value%2A> property of the new <xref:System.Nullable%601> value is initialized to the `value` parameter and the <xref:System.Nullable%601.HasValue%2A> property is initialized to `true`.
540+
541+
The equivalent method for this operator is <xref:System.Nullable%601.%23ctor%28%600%29?displayProperty=nameWithType>
542+
543+
> [!NOTE]
544+
> In C# and Visual Basic, an implicit conversion from `T` to <xref:System.Nullable%601> does not invoke this operator because these languages have special rules for the conversion. This operator is provided for the benefit of languages that do not have such special rules.
545+
546+
> [!NOTE]
547+
> In C# and Visual Basic, an implicit conversion from a `null` or `Nothing` literal to <xref:System.Nullable%601> produces a <xref:System.Nullable%601> value whose <xref:System.Nullable%601.HasValue%2A> property is initialized to `false`. The conversion occurs at compile time in these languages and does not invoke any operator.
548+
549+
]]></format>
544550
</remarks>
545551
</Docs>
546552
</Member>

0 commit comments

Comments
 (0)