Use `nameof` for `[CallerArgumentExpression]`

This commit is contained in:
YoshiRulz 2024-06-06 14:11:24 +10:00
parent e468d6ee76
commit fab1fae66a
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 2 additions and 2 deletions

View File

@ -82,7 +82,7 @@ namespace BizHawk.Common
}
#if NETCOREAPP3_0_OR_GREATER
public static string DescribeIsNull<T>(T? obj, [CallerArgumentExpression("obj")] string? expr = default)
public static string DescribeIsNull<T>(T? obj, [CallerArgumentExpression(nameof(obj))] string? expr = default)
#else
public static string DescribeIsNull<T>(T? obj, string expr)
#endif
@ -90,7 +90,7 @@ namespace BizHawk.Common
=> $"{expr} is {(obj is null ? "null" : "not null")}";
#if NETCOREAPP3_0_OR_GREATER
public static string DescribeIsNullValT<T>(T? boxed, [CallerArgumentExpression("boxed")] string? expr = default)
public static string DescribeIsNullValT<T>(T? boxed, [CallerArgumentExpression(nameof(boxed))] string? expr = default)
#else
public static string DescribeIsNullValT<T>(T? boxed, string expr)
#endif