From 18fcbcbdfa8892d274e5d5b085ac70dad0c29e54 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Thu, 24 Oct 2024 15:55:08 +0100 Subject: [PATCH] Replace a few SuppressMessage annotations with UnconditionalSuppressMessage (#109180) --- .../Json/Serialization/Converters/Value/EnumConverterFactory.cs | 2 +- .../Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverterFactory.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverterFactory.cs index 84ff53a246269..814dd6e890a05 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverterFactory.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Value/EnumConverterFactory.cs @@ -25,7 +25,7 @@ public static bool IsSupportedTypeCode(TypeCode typeCode) or TypeCode.Byte or TypeCode.UInt16 or TypeCode.UInt32 or TypeCode.UInt64; } - [SuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", + [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "The constructor has been annotated with RequiredDynamicCodeAttribute.")] public override JsonConverter CreateConverter(Type type, JsonSerializerOptions options) { diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs index 7bda4bda73f5e..59d53420cb48b 100644 --- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs +++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Metadata/ReflectionEmitMemberAccessor.cs @@ -18,7 +18,7 @@ public ReflectionEmitMemberAccessor() { } - [SuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", + [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with 'RequiresDynamicCodeAttribute' may break functionality when AOT compiling.", Justification = "The constructor has been marked RequiresDynamicCode")] public override Func? CreateParameterlessConstructor(Type type, ConstructorInfo? constructorInfo) {