Skip to content

Commit

Permalink
Merge pull request #86373 from raulsntos/dotnet/fix-nameof
Browse files Browse the repository at this point in the history
C#: Use string literal instead of nameof
  • Loading branch information
YuriSizov authored Dec 21, 2023
2 parents 3a8524d + abd7927 commit 9d1cbab
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ internal static Array<T> CreateTakingOwnershipOfDisposableValue(godot_array nati
/// </summary>
/// <param name="from">The typed array to convert.</param>
/// <returns>A new Godot Array, or <see langword="null"/> if <see paramref="from"/> was null.</returns>
[return: NotNullIfNotNull(nameof(from))]
[return: NotNullIfNotNull("from")]
public static explicit operator Array?(Array<T>? from)
{
return from?._underlyingArray;
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ internal static Dictionary<TKey, TValue> CreateTakingOwnershipOfDisposableValue(
/// </summary>
/// <param name="from">The typed dictionary to convert.</param>
/// <returns>A new Godot Dictionary, or <see langword="null"/> if <see paramref="from"/> was null.</returns>
[return: NotNullIfNotNull(nameof(from))]
[return: NotNullIfNotNull("from")]
public static explicit operator Dictionary?(Dictionary<TKey, TValue>? from)
{
return from?._underlyingDict;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private unsafe static string GetVariantTypeName(godot_variant* variant)
return variant->Type.ToString();
}

internal static void ThrowIfNullPtr(IntPtr ptr, [CallerArgumentExpression(nameof(ptr))] string? paramName = null)
internal static void ThrowIfNullPtr(IntPtr ptr, [CallerArgumentExpression("ptr")] string? paramName = null)
{
if (ptr == IntPtr.Zero)
{
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/glue/GodotSharp/GodotSharp/Core/NodePath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public NodePath(string path)
/// Converts this <see cref="NodePath"/> to a string.
/// </summary>
/// <param name="from">The <see cref="NodePath"/> to convert.</param>
[return: NotNullIfNotNull(nameof(from))]
[return: NotNullIfNotNull("from")]
public static implicit operator string?(NodePath? from) => from?.ToString();

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion modules/mono/glue/GodotSharp/GodotSharp/Core/StringName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public StringName(string name)
/// Converts a <see cref="StringName"/> to a string.
/// </summary>
/// <param name="from">The <see cref="StringName"/> to convert.</param>
[return: NotNullIfNotNull(nameof(from))]
[return: NotNullIfNotNull("from")]
public static implicit operator string?(StringName? from) => from?.ToString();

/// <summary>
Expand Down

0 comments on commit 9d1cbab

Please sign in to comment.