Skip to content

Commit 3bf19a1

Browse files
authored
use nameof for CallerArgumentExpression (#2562)
1 parent b6cfbd0 commit 3bf19a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Shared/ThrowHelpers/ArgumentNullThrowHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ internal static partial class ArgumentNullThrowHelper
1111
/// <summary>Throws an <see cref="ArgumentNullException"/> if <paramref name="argument"/> is null.</summary>
1212
/// <param name="argument">The reference type argument to validate as non-null.</param>
1313
/// <param name="paramName">The name of the parameter with which <paramref name="argument"/> corresponds.</param>
14-
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression("argument")] string? paramName = null)
14+
public static void ThrowIfNull([NotNull] object? argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
1515
{
1616
#if !NET6_0_OR_GREATER
1717
if (argument is null)

0 commit comments

Comments
 (0)