Skip to content

Commit

Permalink
Merge pull request #5296 from smoogipoo/remove-class-constraint
Browse files Browse the repository at this point in the history
Remove class constraint on AsNonNull()
  • Loading branch information
frenzibyte authored Jul 6, 2022
2 parents 84a39e6 + ff963f8 commit 35b0d1d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ public static class ObjectExtensions
/// <param name="obj">The nullable object.</param>
/// <typeparam name="T">The type of the object.</typeparam>
/// <returns>The non-nullable object corresponding to <paramref name="obj"/>.</returns>
public static T AsNonNull<T>(this T? obj)
where T : class
{
return obj!;
}
[return: NotNullIfNotNull("obj")]
public static T AsNonNull<T>(this T? obj) => obj!;

/// <summary>
/// If the given object is null.
Expand Down

0 comments on commit 35b0d1d

Please sign in to comment.