Skip to content

Commit

Permalink
Remove class constraint on AsNonNull()
Browse files Browse the repository at this point in the history
  • Loading branch information
smoogipoo committed Jul 6, 2022
1 parent 84a39e6 commit ff963f8
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 ff963f8

Please sign in to comment.