From ff963f8c98fc4cda688b1a58486c446d89adeadf Mon Sep 17 00:00:00 2001 From: Dan Balasescu Date: Wed, 6 Jul 2022 19:09:34 +0900 Subject: [PATCH] Remove class constraint on AsNonNull() --- .../Extensions/ObjectExtensions/ObjectExtensions.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs b/osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs index 795abccfa0..3bf2f21cfa 100644 --- a/osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs +++ b/osu.Framework/Extensions/ObjectExtensions/ObjectExtensions.cs @@ -19,11 +19,8 @@ public static class ObjectExtensions /// The nullable object. /// The type of the object. /// The non-nullable object corresponding to . - public static T AsNonNull(this T? obj) - where T : class - { - return obj!; - } + [return: NotNullIfNotNull("obj")] + public static T AsNonNull(this T? obj) => obj!; /// /// If the given object is null.