From bd29ed59819c2c920152b4e1651b4a76a47f6e4d Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 5 Jun 2021 16:43:03 +0200 Subject: [PATCH] Revert CSharpPrimitiveCast.cs: its used in Conversions.cs test case and thus must be compatible with old C# compiler versions --- ICSharpCode.Decompiler/Util/CSharpPrimitiveCast.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ICSharpCode.Decompiler/Util/CSharpPrimitiveCast.cs b/ICSharpCode.Decompiler/Util/CSharpPrimitiveCast.cs index cfc8c854c..b57516b45 100644 --- a/ICSharpCode.Decompiler/Util/CSharpPrimitiveCast.cs +++ b/ICSharpCode.Decompiler/Util/CSharpPrimitiveCast.cs @@ -16,10 +16,7 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#nullable enable - using System; -using System.Diagnostics.CodeAnalysis; namespace ICSharpCode.Decompiler.Util { @@ -37,8 +34,7 @@ namespace ICSharpCode.Decompiler.Util /// /// Overflow checking is enabled and an overflow occurred. /// The cast is invalid, e.g. casting a boolean to an integer. - [return: NotNullIfNotNull("input")] - public static object? Cast(TypeCode targetType, object? input, bool checkForOverflow) + public static object Cast(TypeCode targetType, object input, bool checkForOverflow) { if (input == null) return null;