Skip to content

Commit 3d38037

Browse files
authored
Update guidance on ThrowIfNull optional parameter (dotnet#7971)
1 parent 2e89f0a commit 3d38037

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xml/System/ArgumentNullException.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,9 +403,9 @@
403403
</Parameters>
404404
<Docs>
405405
<param name="argument">The reference type argument to validate as non-null.</param>
406-
<param name="paramName">The name of the parameter with which <paramref name="argument" /> corresponds.</param>
406+
<param name="paramName">The name of the parameter with which <paramref name="argument" /> corresponds. If you omit this parameter, the name of <paramref name="argument" /> is used.</param>
407407
<summary>Throws an <see cref="T:System.ArgumentNullException" /> if <paramref name="argument" /> is <see langword="null" />.</summary>
408-
<remarks>To be added.</remarks>
408+
<remarks>The <paramref name="paramName" /> parameter is included to support the <see cref="System.Runtime.CompilerServices.CallerArgumentExpressionAttribute" /> attribute. It's recommended that you don't pass a value for this parameter and let the name of <paramref name="argument" /> be used instead.</remarks>
409409
<exception cref="T:System.ArgumentNullException">
410410
<paramref name="argument" /> is <see langword="null" />.</exception>
411411
</Docs>

0 commit comments

Comments
 (0)