Skip to content

Commit

Permalink
Use nameof for [CallerArgumentExpression]
Browse files Browse the repository at this point in the history
  • Loading branch information
YoshiRulz committed Jun 6, 2024
1 parent e468d6e commit fab1fae
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/BizHawk.Common/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ public static bool DictionaryEqual<TKey, TValue>(IDictionary<TKey, TValue> a, ID
}

#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
where T : class
=> $"{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
Expand Down

0 comments on commit fab1fae

Please sign in to comment.