From 7916a6f7f104a6f30a0267570bb15e43ff529a85 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:04:23 -0700 Subject: [PATCH 1/3] Add more issue links for ExpectedWarnings that don't match --- .../DataFlow/CompilerGeneratedCodeDataflow.cs | 12 +- .../DataFlow/ExceptionalDataFlow.cs | 156 ++--- .../DataFlow/ExponentialDataFlow.cs | 42 +- .../DataFlow/FeatureGuardAttributeDataFlow.cs | 38 +- .../DetectRedundantSuppressionsFromXML.cs | 4 +- .../DetectRedundantSuppressionsInAssembly.cs | 2 +- ...dantSuppressionsInCompilerGeneratedCode.cs | 8 +- ...tRedundantSuppressionsInMembersAndTypes.cs | 638 +++++++++--------- ...uppressionsInMembersAndTypesUsingTarget.cs | 8 +- 9 files changed, 454 insertions(+), 454 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs index e0bb05872b8445..57d58ce1d793a2 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs @@ -38,8 +38,8 @@ static IEnumerable FlowAcrossYieldReturn () } // Trimmer tracks all assignments of hoisted locals, so this produces warnings. - [ExpectedWarning ("IL2072", nameof (GetWithPublicMethods), nameof (DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL2072", [nameof (GetWithPublicFields), nameof (DataFlowTypeExtensions.RequiresPublicMethods)], Tool.Trimmer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [UnexpectedWarning ("IL2072", nameof (GetWithPublicMethods), nameof (DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] + [UnexpectedWarning ("IL2072", [nameof (GetWithPublicFields), nameof (DataFlowTypeExtensions.RequiresPublicMethods)], Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] static IEnumerable NoFlowAcrossYieldReturn () { Type t = GetWithPublicMethods (); @@ -225,8 +225,8 @@ static async void FlowAcrossAwait () } // Trimmer tracks all assignments of hoisted locals, so this produces warnings. - [ExpectedWarning ("IL2072", nameof (GetWithPublicMethods), nameof (DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL2072", nameof (GetWithPublicFields), nameof (DataFlowTypeExtensions.RequiresPublicMethods), Tool.Trimmer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL2072", nameof (GetWithPublicMethods), nameof (DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL2072", nameof (GetWithPublicFields), nameof (DataFlowTypeExtensions.RequiresPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] static async void NoFlowAcrossAwait () { Type t = GetWithPublicMethods (); @@ -443,7 +443,7 @@ public static void ReadCapturedParameterAfterWrite (Type tParameter = null) void LocalFunction () => tParameter.RequiresPublicMethods (); } - [ExpectedWarning ("IL2072", ["tParameter", nameof (GetWithPublicFields)], Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", ["tParameter", nameof (GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/linker/issues/2862")] public static void ReadCapturedParameterAfterWriteMismatch ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] Type tParameter = null) { tParameter = GetWithPublicFields (); @@ -572,7 +572,7 @@ public static void ReadCapturedParameterAfterWrite (Type tParameter = null) lambda (); } - [ExpectedWarning ("IL2072", ["tParameter", nameof (GetWithPublicFields)], Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", ["tParameter", nameof (GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/linker/issues/2862")] public static void ReadCapturedParameterAfterWriteMismatch ([DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)] Type tParameter = null) { tParameter = GetWithPublicFields (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs index 8cc5bf9b6c1a7e..b02effa993c544 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs @@ -46,8 +46,8 @@ public static void Main () ExceptionFilterWithException (); } - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void TryFlowsToFinally () { @@ -107,9 +107,9 @@ public static void MultipleTryExits () // On each path, only one state is possible, but we conservatively merge the (non-exceptional) // finally states for each path and expect the warnings to reflect this merged state. [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] @@ -119,9 +119,9 @@ public static void MultipleTryExits () [ExpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicEvents) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [UnexpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [UnexpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [UnexpectedWarning ("IL2073", nameof (MultipleFinallyPaths) + "()", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] [return: DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.All)] public static Type MultipleFinallyPaths () { @@ -152,11 +152,11 @@ public static Type MultipleFinallyPaths () throw new Exception (); } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void FinallyChain () { @@ -173,12 +173,12 @@ public static void FinallyChain () } } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicProperties) + "()")] @@ -203,8 +203,8 @@ public static void FinallyChainWithPostFinallyState () RequireAll4 (t); } - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void TryFlowsToCatch () { @@ -218,8 +218,8 @@ public static void TryFlowsToCatch () } } - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void CatchFlowsToFinally () { @@ -234,7 +234,7 @@ public static void CatchFlowsToFinally () } } - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void CatchFlowsToAfterTry () { @@ -248,7 +248,7 @@ public static void CatchFlowsToAfterTry () RequireAll (t); } - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void CatchFlowsToAfterFinally () { @@ -282,17 +282,17 @@ public class Exception2 : Exception { } [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll5) + "(Type)", nameof (GetWithPublicEvents) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicEvents) + "()")] @@ -302,16 +302,16 @@ public class Exception2 : Exception { } [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicConstructors) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll5) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll5) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll5) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll5) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll7) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void TryFlowsToMultipleCatchAndFinally () { @@ -336,15 +336,15 @@ public static void TryFlowsToMultipleCatchAndFinally () } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicConstructors) + "()")] public static void NestedWithFinally () @@ -369,14 +369,14 @@ public static void NestedWithFinally () } } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicEvents) + "()")] @@ -404,16 +404,16 @@ public static void ControlFlowsOutOfMultipleFinally () } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicConstructors) + "()")] public static void NestedWithCatch () @@ -440,7 +440,7 @@ public static void NestedWithCatch () [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void CatchInTry () { try { @@ -464,7 +464,7 @@ public static void CatchInTry () // [ExpectedSharedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void CatchInTryWithFinally () { Type t = GetWithPublicConstructors (); @@ -490,10 +490,10 @@ public static void CatchInTryWithFinally () } } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicConstructors) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] static void CatchInFinally () { @@ -513,7 +513,7 @@ static void CatchInFinally () { [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void TestCatchesHaveSeparateState () { Type t = GetWithPublicMethods (); @@ -528,7 +528,7 @@ public static void TestCatchesHaveSeparateState () } [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] public static void FinallyWithBranchToFirstBlock () { Type t = GetWithPublicMethods (); @@ -542,7 +542,7 @@ public static void FinallyWithBranchToFirstBlock () } [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] public static void FinallyWithBranchToFirstBlockAndEnclosingTryCatchState () { try { @@ -564,7 +564,7 @@ public static void FinallyWithBranchToFirstBlockAndEnclosingTryCatchState () } [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] public static void CatchWithBranchToFirstBlock () { Type t = GetWithPublicMethods (); @@ -578,7 +578,7 @@ public static void CatchWithBranchToFirstBlock () } [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] public static void CatchWithBranchToFirstBlockAndReassignment () { Type t = GetWithPublicMethods (); @@ -594,8 +594,8 @@ public static void CatchWithBranchToFirstBlockAndReassignment () [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void CatchWithNonSimplePredecessor () { @@ -617,8 +617,8 @@ public static void CatchWithNonSimplePredecessor () [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void FinallyWithNonSimplePredecessor () { @@ -640,8 +640,8 @@ public static void FinallyWithNonSimplePredecessor () [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicProperties) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] public static void FinallyInTryWithPredecessor () { @@ -661,17 +661,17 @@ public static void FinallyInTryWithPredecessor () } } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void NestedFinally () { Type t = GetWithPublicMethods (); @@ -694,8 +694,8 @@ public static void NestedFinally () [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll4) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void ChangeInFinallyNestedInFinally () { Type t = GetWithPublicMethods (); @@ -712,17 +712,17 @@ public static void ChangeInFinallyNestedInFinally () RequireAll4 (t); // fields only } - [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll1) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties) + "()")] [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll3) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void NestedFinallyWithPredecessor () { Type t = GetWithPublicMethods (); @@ -740,9 +740,9 @@ public static void NestedFinallyWithPredecessor () } } - [ExpectedWarning ("IL2072", nameof (RequireAllTrue) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAllTrue) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAllTrue) + "(Type)", nameof (GetWithPublicFields) + "()")] - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicFields) + "()")] public static void ExceptionFilter () { @@ -760,7 +760,7 @@ public static void ExceptionFilter () [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void ExceptionFilterStateChange () { Type t = GetWithPublicMethods (); @@ -798,9 +798,9 @@ public static void ExceptionFilterStateChange () [ExpectedWarning ("IL2072", nameof (RequireAll6) + "(Type)", nameof (GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void ExceptionMultipleFilters () { Type t = GetWithPublicMethods (); @@ -831,7 +831,7 @@ public static void ExceptionMultipleFilters () [ExpectedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicProperties))] // Trimmer merges branches going forward. - [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods), Tool.Trimmer | Tool.NativeAot, "")] + [ExpectedWarning ("IL2072", nameof (RequireAll) + "(Type)", nameof (GetWithPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] public static void ExceptionFilterWithBranch () { Type t = GetWithPublicMethods (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExponentialDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExponentialDataFlow.cs index dcd3ab55297158..36f1f34229f210 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExponentialDataFlow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExponentialDataFlow.cs @@ -99,27 +99,27 @@ class GenericTypeWithRequires< // ArrayValues in the ValueSet for the pattern in this method, hitting the limit. // When this happens, we replace the ValueSet with an unknown value, producing // this warning. - [ExpectedWarning ("IL2055", Tool.Analyzer, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "")] + [UnexpectedWarning ("IL2055", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] + [ExpectedWarning ("IL2091", "'T'", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/87596")] public static void Test () { Type[] types = new Type[20] { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureGuardAttributeDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureGuardAttributeDataFlow.cs index 6b0e605ac7730d..bf2bf1a2c9d78d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureGuardAttributeDataFlow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/FeatureGuardAttributeDataFlow.cs @@ -65,7 +65,7 @@ static void TestIndirectGuard () // // The analyzer doesn't do constant propagation of the boolean, so it doesn't know that // the return value is always false when TestFeatures.IsUnreferencedCodeSupported is false. - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool AndGuard => TestFeatures.IsUnreferencedCodeSupported && OtherCondition (); @@ -138,7 +138,7 @@ static void TestIsNotFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool IfReturnTrueGuard { get { @@ -148,7 +148,7 @@ static bool IfReturnTrueGuard { } } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool ElseReturnTrueGuard { get { @@ -199,7 +199,7 @@ static void TestAssertNotReturnFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof (RequiresUnreferencedCodeAttribute))] static bool AssertReturnTrueGuard { get { @@ -229,7 +229,7 @@ static void TestThrowGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool TernaryIfGuard => TestFeatures.IsUnreferencedCodeSupported ? true : false; @@ -239,7 +239,7 @@ static void TestTernaryIfGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool TernaryElseGuard => !TestFeatures.IsUnreferencedCodeSupported ? false : true; @@ -275,7 +275,7 @@ public static void Test () } class InvalidGuardBodies { - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool ReturnTrueGuard => true; @@ -285,7 +285,7 @@ static void TestReturnTrueGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool OtherConditionGuard => OtherCondition (); @@ -295,7 +295,7 @@ static void TestOtherConditionGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool OrGuard => TestFeatures.IsUnreferencedCodeSupported || OtherCondition (); @@ -305,7 +305,7 @@ static void TestOrGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool NotGuard => !TestFeatures.IsUnreferencedCodeSupported; @@ -315,7 +315,7 @@ static void TestNotGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool EqualsFalseGuard => TestFeatures.IsUnreferencedCodeSupported == false; @@ -325,7 +325,7 @@ static void TestEqualsFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool FalseEqualsGuard => false == TestFeatures.IsUnreferencedCodeSupported; @@ -335,7 +335,7 @@ static void TestFalseEqualsGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool NotEqualsTrueGuard => TestFeatures.IsUnreferencedCodeSupported != true; @@ -345,7 +345,7 @@ static void TestNotEqualsTrueGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool TrueNotEqualsGuard => true != TestFeatures.IsUnreferencedCodeSupported; @@ -355,7 +355,7 @@ static void TestTrueNotEqualsGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool IsNotTrueGuard => TestFeatures.IsUnreferencedCodeSupported is not true; @@ -365,7 +365,7 @@ static void TestIsNotTrueGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool IsFalseGuard => TestFeatures.IsUnreferencedCodeSupported is false; @@ -375,7 +375,7 @@ static void TestIsFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool IfReturnFalseGuard { get { @@ -391,7 +391,7 @@ static void TestIfReturnFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof(RequiresUnreferencedCodeAttribute))] static bool ElseReturnFalseGuard { get { @@ -408,7 +408,7 @@ static void TestElseReturnFalseGuard () RequiresUnreferencedCode (); } - [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "")] + [ExpectedWarning ("IL4000", nameof (RequiresUnreferencedCodeAttribute), Tool.Analyzer, "FeatureGuards shouldn't rely on constant propagation.")] [FeatureGuard (typeof (RequiresUnreferencedCodeAttribute))] static bool AssertNotReturnTrueGuard { get { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs index aab9f007288864..0a99b82438570f 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs @@ -8,8 +8,8 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { [SkipKeptItemsValidation] [ExpectedNoWarnings] - [ExpectedWarning ("IL2121", "IL2026", Tool.Trimmer, "", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 7)] - [ExpectedWarning ("IL2121", "IL2109", Tool.Trimmer, "", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 12)] + [ExpectedWarning ("IL2121", "IL2026", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 7)] + [ExpectedWarning ("IL2121", "IL2109", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 12)] [SetupLinkAttributesFile ("DetectRedundantSuppressionsFromXML.xml")] public class DetectRedundantSuppressionsFromXML { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInAssembly.cs index 38995365302402..f9c46854b5bfbd 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInAssembly.cs @@ -4,7 +4,7 @@ using System.Diagnostics.CodeAnalysis; using Mono.Linker.Tests.Cases.Expectations.Assertions; -[assembly: ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] +[assembly: ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] [assembly: UnconditionalSuppressMessage ("Test", "IL2071:Redundant suppression, warning is not issued in this assembly")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInCompilerGeneratedCode.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInCompilerGeneratedCode.cs index 54082fccd74e5a..1167da6327c3e7 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInCompilerGeneratedCode.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInCompilerGeneratedCode.cs @@ -34,7 +34,7 @@ public class RedundantSuppressionOnLocalMethod { public static void Test () { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] [UnconditionalSuppressMessage ("Test", "IL2071")] void LocalMethod () { @@ -52,7 +52,7 @@ public static void Test () Enumerable (); } - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] [UnconditionalSuppressMessage ("Test", "IL2071")] static IEnumerable Enumerable () { @@ -63,7 +63,7 @@ static IEnumerable Enumerable () public class RedundantSuppressionInAsyncBody { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] [UnconditionalSuppressMessage ("Test", "IL2071")] public static async void Test () { @@ -71,7 +71,7 @@ public static async void Test () await MethodAsync (); } - [ExpectedWarning ("IL2121", "IL2070", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2070", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] [UnconditionalSuppressMessage ("Test", "IL2070")] static async Task MethodAsync () { diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs index f507fdfc3372cc..ffdfcb0e7bad97 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypes.cs @@ -8,323 +8,323 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { - [ExpectedNoWarnings] - [SkipKeptItemsValidation] - [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")] - public class DetectRedundantSuppressionsInMembersAndTypes - { - public static void Main () - { - RedundantSuppressionOnType.Test (); - RedundantSuppressionOnMethod.Test (); - RedundantSuppressionOnNestedType.Test (); - - RedundantSuppressionOnPropertyGet.Test (); - RedundantSuppressionOnProperty.Test (); - RedundantSuppressionOnPropertyWithOnlyGet.Test (); - RedundantSuppressionOnPropertyWithOnlySet.Test (); - RedundantSuppressionOnPropertyAccessedByReflection.Test (); - - RedundantSuppressionOnEventAdd.Test (); - RedundantSuppressionOnEvent.Test (); - RedundantSuppressionOnEventAccessedByReflection.Test (); - - MultipleRedundantSuppressions.Test (); - RedundantAndUsedSuppressions.Test (); - - DoNotReportNonLinkerSuppressions.Test (); - DoNotReportSuppressionsOnMethodsConvertedToThrow.Test (); - - SuppressRedundantSuppressionWarning.Test (); - DoNotReportUnnecessaryRedundantWarningSuppressions.Test (); - - RedundantSuppressionWithRUC.Test (); - } - - public static Type TriggerUnrecognizedPattern () - { - return typeof (DetectRedundantSuppressionsInMembersAndTypes); - } - - public static string TrimmerCompatibleMethod () - { - return "test"; - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public class RedundantSuppressionOnType - { - public static void Test () - { - TrimmerCompatibleMethod (); - } - } - - public class RedundantSuppressionOnMethod - { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static void Test () - { - TrimmerCompatibleMethod (); - } - } - - public class RedundantSuppressionOnNestedType - { - public static void Test () - { - NestedType.TrimmerCompatibleMethod (); - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public class NestedType - { - public static void TrimmerCompatibleMethod () - { - DetectRedundantSuppressionsInMembersAndTypes.TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnPropertyGet - { - public static void Test () - { - var property = TrimmerCompatibleProperty; - } - - public static string TrimmerCompatibleProperty { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - get { - return TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnProperty - { - public static void Test () - { - var property = TrimmerCompatibleProperty; - TrimmerCompatibleProperty = "test"; - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static string TrimmerCompatibleProperty { - get { - return TrimmerCompatibleMethod (); - } - set { - value = TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnPropertyWithOnlyGet - { - public static void Test () - { - var property = TrimmerCompatibleProperty; - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static string TrimmerCompatibleProperty { - get { - return TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnPropertyWithOnlySet - { - public static void Test () - { - TrimmerCompatibleProperty = "test"; - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static string TrimmerCompatibleProperty { - set { - value = TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnPropertyAccessedByReflection - { - public static void Test () - { - typeof (RedundantSuppressionOnPropertyAccessedByReflection).GetProperty ("TrimmerCompatibleProperty"); - } - - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static string TrimmerCompatibleProperty { - get { - return TrimmerCompatibleMethod (); - } - } - } - - public class RedundantSuppressionOnEventAdd - { - public static void Test () - { - TrimmerCompatibleEvent += EventSubscriber; - } - - static void EventSubscriber (object sender, EventArgs e) - { - - } - - public static event EventHandler TrimmerCompatibleEvent { - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - add { TrimmerCompatibleMethod (); } - remove { } - } - } - - public class RedundantSuppressionOnEvent - { - public static void Test () - { - TrimmerCompatibleEvent += EventSubscriber; - } - - static void EventSubscriber (object sender, EventArgs e) - { - - } - - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - public static event EventHandler TrimmerCompatibleEvent { - add { TrimmerCompatibleMethod (); } - remove { } - } - } - - public class RedundantSuppressionOnEventAccessedByReflection - { - public static void Test () - { - typeof (RedundantSuppressionOnEventAccessedByReflection).GetEvent ("TrimmerCompatibleEvent"); - } - - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - public static event EventHandler TrimmerCompatibleEvent { - add { TrimmerCompatibleMethod (); } - remove { } - } - } - - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public class MultipleRedundantSuppressions - { - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - public static void Test () - { - TrimmerCompatibleMethod (); - } - } - - public class RedundantAndUsedSuppressions - { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2071")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - public static void Test () - { - Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); - } - } - - public class DoNotReportNonLinkerSuppressions - { - [UnconditionalSuppressMessage ("Test", "IL3052")] - public static void Test () - { - TrimmerCompatibleMethod (); - } - } - - public class DoNotReportSuppressionsOnMethodsConvertedToThrow - { - // The tool is unable to determine whether a suppression is redundant when it is placed on a method with unreachable body. - // Currently suppressions on methods with unreachable bodies should never be reported as redundant. - // https://github.com/dotnet/linker/issues/2920 - public static void Test () - { - UsedToMarkMethod (null); - } - - static void UsedToMarkMethod (TypeWithMethodConvertedToThrow t) - { - t.MethodConvertedToThrow (); - } - - class TypeWithMethodConvertedToThrow - { - // The suppression is redundant, but it should not be reported. - [UnconditionalSuppressMessage ("Test", "IL2072")] - public void MethodConvertedToThrow () - { - TrimmerCompatibleMethod (); - } - } - } - - public class SuppressRedundantSuppressionWarning - { - [UnconditionalSuppressMessage ("Test", "IL2121")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - public static void Test () - { - TrimmerCompatibleMethod (); - } - } - - public class DoNotReportUnnecessaryRedundantWarningSuppressions - { - [UnconditionalSuppressMessage ("Test", "IL2121")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - public static void Test () - { - Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); - } - } - - public class RedundantSuppressionWithRUC - { - [ExpectedWarning ("IL2026")] - public static void Test () - { - MethodMarkedRUC (); - } - - [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "")] - [UnconditionalSuppressMessage ("Test", "IL2072")] - [RequiresUnreferencedCode ("Test")] - public static void MethodMarkedRUC () - { - Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); - } - } - } + [ExpectedNoWarnings] + [SkipKeptItemsValidation] + [UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")] + public class DetectRedundantSuppressionsInMembersAndTypes + { + public static void Main () + { + RedundantSuppressionOnType.Test (); + RedundantSuppressionOnMethod.Test (); + RedundantSuppressionOnNestedType.Test (); + + RedundantSuppressionOnPropertyGet.Test (); + RedundantSuppressionOnProperty.Test (); + RedundantSuppressionOnPropertyWithOnlyGet.Test (); + RedundantSuppressionOnPropertyWithOnlySet.Test (); + RedundantSuppressionOnPropertyAccessedByReflection.Test (); + + RedundantSuppressionOnEventAdd.Test (); + RedundantSuppressionOnEvent.Test (); + RedundantSuppressionOnEventAccessedByReflection.Test (); + + MultipleRedundantSuppressions.Test (); + RedundantAndUsedSuppressions.Test (); + + DoNotReportNonLinkerSuppressions.Test (); + DoNotReportSuppressionsOnMethodsConvertedToThrow.Test (); + + SuppressRedundantSuppressionWarning.Test (); + DoNotReportUnnecessaryRedundantWarningSuppressions.Test (); + + RedundantSuppressionWithRUC.Test (); + } + + public static Type TriggerUnrecognizedPattern () + { + return typeof (DetectRedundantSuppressionsInMembersAndTypes); + } + + public static string TrimmerCompatibleMethod () + { + return "test"; + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public class RedundantSuppressionOnType + { + public static void Test () + { + TrimmerCompatibleMethod (); + } + } + + public class RedundantSuppressionOnMethod + { + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static void Test () + { + TrimmerCompatibleMethod (); + } + } + + public class RedundantSuppressionOnNestedType + { + public static void Test () + { + NestedType.TrimmerCompatibleMethod (); + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public class NestedType + { + public static void TrimmerCompatibleMethod () + { + DetectRedundantSuppressionsInMembersAndTypes.TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnPropertyGet + { + public static void Test () + { + var property = TrimmerCompatibleProperty; + } + + public static string TrimmerCompatibleProperty { + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + get { + return TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnProperty + { + public static void Test () + { + var property = TrimmerCompatibleProperty; + TrimmerCompatibleProperty = "test"; + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static string TrimmerCompatibleProperty { + get { + return TrimmerCompatibleMethod (); + } + set { + value = TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnPropertyWithOnlyGet + { + public static void Test () + { + var property = TrimmerCompatibleProperty; + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static string TrimmerCompatibleProperty { + get { + return TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnPropertyWithOnlySet + { + public static void Test () + { + TrimmerCompatibleProperty = "test"; + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static string TrimmerCompatibleProperty { + set { + value = TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnPropertyAccessedByReflection + { + public static void Test () + { + typeof (RedundantSuppressionOnPropertyAccessedByReflection).GetProperty ("TrimmerCompatibleProperty"); + } + + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static string TrimmerCompatibleProperty { + get { + return TrimmerCompatibleMethod (); + } + } + } + + public class RedundantSuppressionOnEventAdd + { + public static void Test () + { + TrimmerCompatibleEvent += EventSubscriber; + } + + static void EventSubscriber (object sender, EventArgs e) + { + + } + + public static event EventHandler TrimmerCompatibleEvent { + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + add { TrimmerCompatibleMethod (); } + remove { } + } + } + + public class RedundantSuppressionOnEvent + { + public static void Test () + { + TrimmerCompatibleEvent += EventSubscriber; + } + + static void EventSubscriber (object sender, EventArgs e) + { + + } + + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + public static event EventHandler TrimmerCompatibleEvent { + add { TrimmerCompatibleMethod (); } + remove { } + } + } + + public class RedundantSuppressionOnEventAccessedByReflection + { + public static void Test () + { + typeof (RedundantSuppressionOnEventAccessedByReflection).GetEvent ("TrimmerCompatibleEvent"); + } + + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + public static event EventHandler TrimmerCompatibleEvent { + add { TrimmerCompatibleMethod (); } + remove { } + } + } + + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public class MultipleRedundantSuppressions + { + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + public static void Test () + { + TrimmerCompatibleMethod (); + } + } + + public class RedundantAndUsedSuppressions + { + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2071")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + public static void Test () + { + Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); + } + } + + public class DoNotReportNonLinkerSuppressions + { + [UnconditionalSuppressMessage ("Test", "IL3052")] + public static void Test () + { + TrimmerCompatibleMethod (); + } + } + + public class DoNotReportSuppressionsOnMethodsConvertedToThrow + { + // The tool is unable to determine whether a suppression is redundant when it is placed on a method with unreachable body. + // Currently suppressions on methods with unreachable bodies should never be reported as redundant. + // https://github.com/dotnet/linker/issues/2920 + public static void Test () + { + UsedToMarkMethod (null); + } + + static void UsedToMarkMethod (TypeWithMethodConvertedToThrow t) + { + t.MethodConvertedToThrow (); + } + + class TypeWithMethodConvertedToThrow + { + // The suppression is redundant, but it should not be reported. + [UnconditionalSuppressMessage ("Test", "IL2072")] + public void MethodConvertedToThrow () + { + TrimmerCompatibleMethod (); + } + } + } + + public class SuppressRedundantSuppressionWarning + { + [UnconditionalSuppressMessage ("Test", "IL2121")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + public static void Test () + { + TrimmerCompatibleMethod (); + } + } + + public class DoNotReportUnnecessaryRedundantWarningSuppressions + { + [UnconditionalSuppressMessage ("Test", "IL2121")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + public static void Test () + { + Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); + } + } + + public class RedundantSuppressionWithRUC + { + [ExpectedWarning ("IL2026")] + public static void Test () + { + MethodMarkedRUC (); + } + + [ExpectedWarning ("IL2121", "IL2072", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] + [UnconditionalSuppressMessage ("Test", "IL2072")] + [RequiresUnreferencedCode ("Test")] + public static void MethodMarkedRUC () + { + Expression.Call (TriggerUnrecognizedPattern (), "", Type.EmptyTypes); + } + } + } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypesUsingTarget.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypesUsingTarget.cs index 6b6c3df46f5bf2..5d0ff848047759 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypesUsingTarget.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsInMembersAndTypesUsingTarget.cs @@ -37,7 +37,7 @@ public static string TrimmerCompatibleMethod () return "test"; } - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] public class RedundantSuppressionOnType { public static void Test () @@ -48,7 +48,7 @@ public static void Test () public class RedundantSuppressionOnMethod { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] public static void Test () { TrimmerCompatibleMethod (); @@ -62,7 +62,7 @@ public static void Test () NestedType.TrimmerCompatibleMethod (); } - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] public class NestedType { public static void TrimmerCompatibleMethod () @@ -80,7 +80,7 @@ public static void Test () } public static string TrimmerCompatibleProperty { - [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "")] + [ExpectedWarning ("IL2121", "IL2071", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971")] get { return TrimmerCompatibleMethod (); } From cdb42082a1345ba25c7dba2595fb6028c6958ed2 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Wed, 18 Jun 2025 16:08:45 -0700 Subject: [PATCH 2/3] Add reason for IL3XXX warnings with no trimmer warning as AOT-specific --- .../DataFlow/MakeGenericDataflowIntrinsics.cs | 8 +- ...odHierarchyDataflowAnnotationValidation.cs | 4 +- .../RequiresCapability/BasicRequires.cs | 46 ++--- .../RequiresAccessedThrough.cs | 42 ++--- .../RequiresAttributeMismatch.cs | 132 +++++++------- .../RequiresInCompilerGeneratedCode.cs | 164 +++++++++--------- .../RequiresCapability/RequiresOnAttribute.cs | 44 ++--- .../RequiresCapability/RequiresOnClass.cs | 10 +- .../RequiresOnStaticConstructor.cs | 16 +- .../RequiresOnVirtualsAndInterfaces.cs | 40 ++--- .../RequiresWithCopyAssembly.cs | 4 +- 11 files changed, 255 insertions(+), 255 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataflowIntrinsics.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataflowIntrinsics.cs index 0154885b2f3d80..72c0ddc325ecbb 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataflowIntrinsics.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/MakeGenericDataflowIntrinsics.cs @@ -38,10 +38,10 @@ public static void Test () public static void TestRecognizedConstraint () => typeof (GenConstrained<>).MakeGenericType (GrabUnknownType ()); [ExpectedWarning ("IL2055", nameof (Type.MakeGenericType))] - [ExpectedWarning ("IL3050", nameof (Type.MakeGenericType), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", nameof (Type.MakeGenericType), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestUnknownOwningType () => GrabUnknownType ().MakeGenericType (typeof (object)); - [ExpectedWarning ("IL3050", nameof (Type.MakeGenericType), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", nameof (Type.MakeGenericType), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestUnknownArgument () => typeof (Gen<>).MakeGenericType (GrabUnknownType ()); } @@ -70,10 +70,10 @@ public static void Test () public static void TestRecognizedConstraint () => typeof (MakeGenericMethod).GetMethod (nameof (GenConstrained)).MakeGenericMethod (GrabUnknownType ()); [ExpectedWarning ("IL2060", nameof (MethodInfo.MakeGenericMethod))] - [ExpectedWarning ("IL3050", nameof (MethodInfo.MakeGenericMethod), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", nameof (MethodInfo.MakeGenericMethod), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestUnknownOwningMethod () => GrabUnknownMethod ().MakeGenericMethod (typeof (object)); - [ExpectedWarning ("IL3050", nameof (MethodInfo.MakeGenericMethod), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", nameof (MethodInfo.MakeGenericMethod), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestUnknownArgument () => typeof (MakeGenericMethod).GetMethod (nameof (Gen)).MakeGenericMethod (GrabUnknownType()); } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs index b56d5d0ba1918a..8ce68ed34c516d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/VirtualMethodHierarchyDataflowAnnotationValidation.cs @@ -1047,8 +1047,8 @@ public override void MethodWithRequires ([DynamicallyAccessedMembers (Dynamicall [ExpectedWarning ("IL2026", nameof (DerivedTypeWithRequires_BaseMethodWithRequires))] [ExpectedWarning ("IL2026", nameof (DerivedTypeWithRequires_BaseMethodWithRequires.MethodWithRequires))] - [ExpectedWarning ("IL3050", nameof (DerivedTypeWithRequires_BaseMethodWithRequires), Tool.NativeAot | Tool.Analyzer, "")] - [ExpectedWarning ("IL3050", nameof (DerivedTypeWithRequires_BaseMethodWithRequires.MethodWithRequires), Tool.NativeAot | Tool.Analyzer, "")] + [ExpectedWarning ("IL3050", nameof (DerivedTypeWithRequires_BaseMethodWithRequires), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", nameof (DerivedTypeWithRequires_BaseMethodWithRequires.MethodWithRequires), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void Test_DerivedTypeWithRequires_BaseMethodWithRequires () { new DerivedTypeWithRequires_BaseMethodWithRequires ().MethodWithRequires (typeof (int)); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/BasicRequires.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/BasicRequires.cs index 4fbb99df86ea67..b04aa71bfc596d 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/BasicRequires.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/BasicRequires.cs @@ -28,8 +28,8 @@ public static void Main () } [ExpectedWarning ("IL2026", "Message for --RequiresWithMessageOnly--.")] - [ExpectedWarning ("IL3002", "Message for --RequiresWithMessageOnly--.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Message for --RequiresWithMessageOnly--.", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Message for --RequiresWithMessageOnly--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Message for --RequiresWithMessageOnly--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestRequiresWithMessageOnlyOnMethod () { RequiresWithMessageOnly (); @@ -43,8 +43,8 @@ static void RequiresWithMessageOnly () } [ExpectedWarning ("IL2026", "Message for --RequiresWithMessageAndUrl--.", "https://helpurl")] - [ExpectedWarning ("IL3002", "Message for --RequiresWithMessageAndUrl--.", "https://helpurl", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Message for --RequiresWithMessageAndUrl--.", "https://helpurl", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Message for --RequiresWithMessageAndUrl--.", "https://helpurl", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Message for --RequiresWithMessageAndUrl--.", "https://helpurl", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestRequiresWithMessageAndUrlOnMethod () { RequiresWithMessageAndUrl (); @@ -58,8 +58,8 @@ static void RequiresWithMessageAndUrl () } [ExpectedWarning ("IL2026", "Message for --ConstructorRequires--.")] - [ExpectedWarning ("IL3002", "Message for --ConstructorRequires--.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Message for --ConstructorRequires--.", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Message for --ConstructorRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Message for --ConstructorRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestRequiresOnConstructor () { new ConstructorRequires (); @@ -77,10 +77,10 @@ public ConstructorRequires () [ExpectedWarning ("IL2026", "Message for --getter PropertyRequires--.")] [ExpectedWarning ("IL2026", "Message for --setter PropertyRequires--.")] - [ExpectedWarning ("IL3002", "Message for --getter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3002", "Message for --setter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Message for --getter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Message for --setter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Message for --getter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3002", "Message for --setter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Message for --getter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Message for --setter PropertyRequires--.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestRequiresOnPropertyGetterAndSetter () { _ = PropertyRequires; @@ -107,8 +107,8 @@ static void WarningMessageWithoutEndingPeriod () } [ExpectedWarning ("IL2026", "Adds a trailing period to this message.")] - [ExpectedWarning ("IL3002", "Adds a trailing period to this message.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Adds a trailing period to this message.", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Adds a trailing period to this message.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Adds a trailing period to this message.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestThatTrailingPeriodIsAddedToMessage () { WarningMessageWithoutEndingPeriod (); @@ -123,8 +123,8 @@ static void WarningMessageEndsWithPeriod () [LogDoesNotContain ("Does not add a period to this message..")] [ExpectedWarning ("IL2026", "Does not add a period to this message.")] - [ExpectedWarning ("IL3002", "Does not add a period to this message.", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Does not add a period to this message.", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Does not add a period to this message.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Does not add a period to this message.", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestThatTrailingPeriodIsNotDuplicatedInWarningMessage () { WarningMessageEndsWithPeriod (); @@ -188,8 +188,8 @@ public static void GenericTypeWithStaticMethodWhichRequires () { } } [ExpectedWarning ("IL2026", "--GenericTypeWithStaticMethodWhichRequires--")] - [ExpectedWarning ("IL3002", "--GenericTypeWithStaticMethodWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--GenericTypeWithStaticMethodWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--GenericTypeWithStaticMethodWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--GenericTypeWithStaticMethodWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void GenericTypeWithStaticMethodViaLdftn () { var _ = new Action (GenericWithStaticMethod.GenericTypeWithStaticMethodWhichRequires); @@ -215,8 +215,8 @@ static void Requires () { } [RequiresAssemblyFiles ("--PropertyRequires--")] static int PropertyRequires { get; set; } - [ExpectedWarning ("IL3002", "--PropertyRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3002", "--PropertyRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--PropertyRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3002", "--PropertyRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestProperty () { var a = PropertyRequires; @@ -226,11 +226,11 @@ static void TestProperty () [RequiresAssemblyFiles ("--EventRequires--")] static event EventHandler EventRequires; - [ExpectedWarning ("IL3002", "--EventRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3002", "--EventRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--EventRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3002", "--EventRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--RequiresOnEventLambda--")] - [ExpectedWarning ("IL3002", "--RequiresOnEventLambda--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--RequiresOnEventLambda--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--RequiresOnEventLambda--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--RequiresOnEventLambda--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestEvent () { EventRequires += (object sender, EventArgs e) => throw new NotImplementedException (); @@ -258,7 +258,7 @@ class DynamicCodeOnly [RequiresDynamicCode ("--Requires--")] static void Requires () { } - [ExpectedWarning ("IL3050", "--Requires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "--Requires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { Requires (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAccessedThrough.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAccessedThrough.cs index 4cc82678f786c6..fac8988bb81a8b 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAccessedThrough.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAccessedThrough.cs @@ -132,8 +132,8 @@ class NewConstraintTestAnnotatedType [ExpectedWarning ("IL2026", "--NewConstraintTestType.ctor--")] [ExpectedWarning ("IL2026", "--NewConstraintTestAnnotatedType--")] - [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () where T : new() { GenericMethod (); @@ -152,8 +152,8 @@ public static void DoNothing () { } [ExpectedWarning ("IL2026", "--NewConstraintTestType.ctor--")] [ExpectedWarning ("IL2026", "--NewConstraintTestAnnotatedType--")] - [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestNewConstraintOnTypeParameter () where T : new() { _ = new NewConstraintOnTypeParameter (); @@ -162,8 +162,8 @@ public static void DoNothing () { } } [ExpectedWarning ("IL2026", "--AnnotatedMethod--")] - [ExpectedWarning ("IL3002", "--AnnotatedMethod--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AnnotatedMethod--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AnnotatedMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AnnotatedMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestNewConstraintOnTypeParameterInAnnotatedMethod () { AnnotatedMethod (); @@ -187,8 +187,8 @@ public static void TestNewConstraintOnTypeParameterInAnnotatedType () [RequiresUnreferencedCode ("--AnnotatedType--")] class AnnotatedType { - [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Method () { _ = new NewConstraintOnTypeParameter (); @@ -198,8 +198,8 @@ public static void Method () [ExpectedWarning ("IL2026", "--NewConstraintTestType.ctor--")] [ExpectedWarning ("IL2026", "--NewConstraintTestAnnotatedType--")] - [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--NewConstraintTestType.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void TestNewConstraintOnTypeParameterOfStaticType () where T : new() { NewConstraintOnTypeParameterOfStaticType.DoNothing (); @@ -221,9 +221,9 @@ static bool PropertyWithLdToken { [ExpectedWarning ("IL2026", "--PropertyWithLdToken.get--")] [ExpectedWarning ("IL2026", "--PropertyWithLdToken.get--", Tool.Trimmer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3002", "--PropertyWithLdToken.get--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--PropertyWithLdToken.get--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL3002", "--PropertyWithLdToken.get--", Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--PropertyWithLdToken.get--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "--PropertyWithLdToken.get--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL3050", "--PropertyWithLdToken.get--", Tool.NativeAot, "")] static void TestPropertyLdToken () { @@ -238,8 +238,8 @@ static void MethodWithLdToken () } [ExpectedWarning ("IL2026", "--MethodWithLdToken--")] - [ExpectedWarning ("IL3002", "--MethodWithLdToken--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithLdToken--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithLdToken--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithLdToken--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestMethodLdToken () { Expression e = () => MethodWithLdToken (); @@ -253,7 +253,7 @@ class FieldWithLdTokenType } [ExpectedWarning ("IL2026", "--FieldWithLdToken--")] - [ExpectedWarning ("IL3050", "--FieldWithLdToken--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "--FieldWithLdToken--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestFieldLdToken () { Expression> f = () => FieldWithLdTokenType.Field; @@ -277,16 +277,16 @@ static void MethodWithDelegate () } [ExpectedWarning ("IL2026", "--MethodWithDelegate--")] - [ExpectedWarning ("IL3002", "--MethodWithDelegate--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithDelegate--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestMethodWithDelegate () { Action a = MethodWithDelegate; } [ExpectedWarning ("IL2026", "--LambdaThroughDelegate--")] - [ExpectedWarning ("IL3002", "--LambdaThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--LambdaThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--LambdaThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--LambdaThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void LambdaThroughDelegate () { Action a = @@ -299,8 +299,8 @@ static void LambdaThroughDelegate () } [ExpectedWarning ("IL2026", "--LocalFunctionThroughDelegate--")] - [ExpectedWarning ("IL3002", "--LocalFunctionThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--LocalFunctionThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--LocalFunctionThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--LocalFunctionThroughDelegate--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void LocalFunctionThroughDelegate () { Action a = Local; diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAttributeMismatch.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAttributeMismatch.cs index 94249d6af5b6f0..43145441184788 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAttributeMismatch.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresAttributeMismatch.cs @@ -174,8 +174,8 @@ class DerivedClassWithRequires : BaseClassWithoutRequires [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] [ExpectedWarning ("IL2046", "DerivedClassWithRequires.VirtualMethod()", "BaseClassWithoutRequires.VirtualMethod()")] - [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualMethod()", "BaseClassWithoutRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "DerivedClassWithRequires.VirtualMethod()", "BaseClassWithoutRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualMethod()", "BaseClassWithoutRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "DerivedClassWithRequires.VirtualMethod()", "BaseClassWithoutRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public override void VirtualMethod () { } @@ -183,8 +183,8 @@ public override void VirtualMethod () private string name; public override string VirtualPropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "DerivedClassWithRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message")] [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] @@ -194,9 +194,9 @@ public override string VirtualPropertyAnnotationInAccesor { [RequiresAssemblyFiles ("Message")] public override string VirtualPropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithoutRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithoutRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithoutRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithoutRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -237,8 +237,8 @@ public static void Test() class DerivedClassWithoutRequires : BaseClassWithRequires { [ExpectedWarning ("IL2046", "DerivedClassWithoutRequires.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()")] - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "DerivedClassWithoutRequires.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "DerivedClassWithoutRequires.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public override void VirtualMethod () { } @@ -246,24 +246,24 @@ public override void VirtualMethod () private string name; public override string VirtualPropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get { return name; } set { name = value; } } public override string VirtualPropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInProperty", "BaseClassWithRequires.VirtualPropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } public override string VirtualPropertyAnnotationInPropertyAndAccessor { [ExpectedWarning ("IL2046", "VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get")] - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInPropertyAndAccessor", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithoutRequires.VirtualPropertyAnnotationInPropertyAndAccessor", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -271,8 +271,8 @@ public override string VirtualPropertyAnnotationInPropertyAndAccessor { class DerivedClassWithAllWarnings : BaseClassWithRequires { [ExpectedWarning ("IL2046", "DerivedClassWithAllWarnings.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()")] - [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "DerivedClassWithAllWarnings.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "DerivedClassWithAllWarnings.VirtualMethod()", "BaseClassWithRequires.VirtualMethod()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public override void VirtualMethod () { } @@ -282,12 +282,12 @@ public override void VirtualMethod () [RequiresAssemblyFiles ("Message")] public override string VirtualPropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3051", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3051", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get { return name; } [RequiresAssemblyFiles ("Message")] [RequiresUnreferencedCode ("Message")] [ExpectedWarning ("IL2046", "VirtualPropertyAnnotationInAccesor.set", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.set")] - [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.set", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.set", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInAccesor.set", "BaseClassWithRequires.VirtualPropertyAnnotationInAccesor.set", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set { name = value; } } @@ -304,7 +304,7 @@ public override string VirtualPropertyAnnotationInProperty { public override string VirtualPropertyAnnotationInPropertyAndAccessor { [ExpectedWarning ("IL2046", "VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get")] - [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "DerivedClassWithAllWarnings.VirtualPropertyAnnotationInPropertyAndAccessor.get", "BaseClassWithRequires.VirtualPropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; [RequiresAssemblyFiles ("Message")] [RequiresUnreferencedCode ("Message")] @@ -357,8 +357,8 @@ class ImplementationClassWithRequires : IBaseWithoutRequires [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] [ExpectedWarning ("IL2046", "ImplementationClassWithRequires.Method()", "IBaseWithoutRequires.Method()")] - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.Method()", "IBaseWithoutRequires.Method()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithRequires.Method()", "IBaseWithoutRequires.Method()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.Method()", "IBaseWithoutRequires.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithRequires.Method()", "IBaseWithoutRequires.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public void Method () { } @@ -366,8 +366,8 @@ public void Method () private string name; public string PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithRequires.PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message")] [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] @@ -378,9 +378,9 @@ public string PropertyAnnotationInAccesor { [RequiresAssemblyFiles ("Message")] [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer, "")] public string PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.NativeAot | Tool.Analyzer, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.NativeAot | Tool.Analyzer, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } @@ -390,9 +390,9 @@ public string PropertyAnnotationInPropertyAndAccessor { [RequiresAssemblyFiles ("Message")] [RequiresUnreferencedCode ("Message")] [ExpectedWarning ("IL2046", "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get")] - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequires.PropertyAnnotationInPropertyAndAccessor", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -416,8 +416,8 @@ void IBaseWithoutRequires.Method () private string name; string IBaseWithoutRequires.PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "PropertyAnnotationInAccesor.get", "IBaseWithoutRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message")] [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] @@ -428,9 +428,9 @@ string IBaseWithoutRequires.PropertyAnnotationInAccesor { [RequiresAssemblyFiles ("Message")] [ExpectedWarning ("IL3003", "ExplicitImplementationClassWithRequires.Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithoutRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer, "")] string IBaseWithoutRequires.PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithoutRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithoutRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithoutRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithoutRequires.PropertyAnnotationInProperty", "IBaseWithoutRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } @@ -440,9 +440,9 @@ string IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor { [RequiresAssemblyFiles ("Message")] [RequiresUnreferencedCode ("Message")] [ExpectedWarning ("IL2046", "PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get")] - [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor", "IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -450,8 +450,8 @@ string IBaseWithoutRequires.PropertyAnnotationInPropertyAndAccessor { class ImplementationClassWithoutRequires : IBaseWithRequires { [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequires.Method()", "IBaseWithRequires.Method()")] - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.Method()", "IBaseWithRequires.Method()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequires.Method()", "IBaseWithRequires.Method()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.Method()", "IBaseWithRequires.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequires.Method()", "IBaseWithRequires.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public void Method () { } @@ -459,17 +459,17 @@ public void Method () private string name; public string PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequires.PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequires.PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequires.PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get { return name; } set { name = value; } } [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer, "")] public string PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } @@ -480,7 +480,7 @@ public string PropertyAnnotationInPropertyAndAccessor { [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.get", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.get")] get; [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set")] - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequires.PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -501,26 +501,26 @@ void IBaseWithRequires.Method () private string name; string IBaseWithRequires.PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "PropertyAnnotationInAccesor.get", "IBaseWithRequires.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get { return name; } set { name = value; } } [ExpectedWarning ("IL3003", "ExplicitImplementationClassWithoutRequires.Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer, "")] string IBaseWithRequires.PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInProperty", "IBaseWithRequires.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } [ExpectedWarning ("IL3003", "ExplicitImplementationClassWithoutRequires.Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer, "")] string IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor { - [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "Mono.Linker.Tests.Cases.RequiresCapability.RequiresAttributeMismatch.IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; [ExpectedWarning ("IL2046", "PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set")] - [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "PropertyAnnotationInPropertyAndAccessor.set", "IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor.set", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -528,8 +528,8 @@ string IBaseWithRequires.PropertyAnnotationInPropertyAndAccessor { class ImplementationClassWithoutRequiresInSource : ReferenceInterfaces.IBaseWithRequiresInReference { [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequiresInSource.Method()", "IBaseWithRequiresInReference.Method()")] - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.Method()", "IBaseWithRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequiresInSource.Method()", "IBaseWithRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.Method()", "IBaseWithRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequiresInSource.Method()", "IBaseWithRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public void Method () { } @@ -537,17 +537,17 @@ public void Method () private string name; public string PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithRequiresInReference.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get { return name; } set { name = value; } } [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInProperty", "IBaseWithRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer, "")] public string PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInProperty.get", "IBaseWithRequiresInReference.PropertyAnnotationInProperty.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInProperty.get", "IBaseWithRequiresInReference.PropertyAnnotationInProperty.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInProperty.set", "IBaseWithRequiresInReference.PropertyAnnotationInProperty.set", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithoutRequiresInSource.PropertyAnnotationInProperty.set", "IBaseWithRequiresInReference.PropertyAnnotationInProperty.set", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -555,8 +555,8 @@ public string PropertyAnnotationInProperty { class ImplementationClassWithRequiresInSource : ReferenceInterfaces.IBaseWithoutRequiresInReference { [ExpectedWarning ("IL2046", "ImplementationClassWithRequiresInSource.Method()", "IBaseWithoutRequiresInReference.Method()")] - [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.Method()", "IBaseWithoutRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithRequiresInSource.Method()", "IBaseWithoutRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.Method()", "IBaseWithoutRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithRequiresInSource.Method()", "IBaseWithoutRequiresInReference.Method()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message")] [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] @@ -567,8 +567,8 @@ public void Method () private string name; public string PropertyAnnotationInAccesor { [ExpectedWarning ("IL2046", "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithoutRequiresInReference.PropertyAnnotationInAccesor.get")] - [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithoutRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithoutRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithoutRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplementationClassWithRequiresInSource.PropertyAnnotationInAccesor.get", "IBaseWithoutRequiresInReference.PropertyAnnotationInAccesor.get", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message")] [RequiresAssemblyFiles ("Message")] [RequiresDynamicCode ("Message")] @@ -579,9 +579,9 @@ public string PropertyAnnotationInAccesor { [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInProperty", "IBaseWithoutRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer, "")] [RequiresAssemblyFiles ("Message")] public string PropertyAnnotationInProperty { - [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInProperty", "IBaseWithoutRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInProperty", "IBaseWithoutRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] get; - [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInProperty", "IBaseWithoutRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplementationClassWithRequiresInSource.PropertyAnnotationInProperty", "IBaseWithoutRequiresInReference.PropertyAnnotationInProperty", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] set; } } @@ -650,13 +650,13 @@ public static void AbstractMethod () { } class ImplIRequiresMismatching : IRequires { [ExpectedWarning ("IL2046", "ImplIRequiresMismatching.VirtualMethod", "IRequires.VirtualMethod")] - [ExpectedWarning ("IL3003", "ImplIRequiresMismatching.VirtualMethod", "IRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplIRequiresMismatching.VirtualMethod", "IRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplIRequiresMismatching.VirtualMethod", "IRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplIRequiresMismatching.VirtualMethod", "IRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void VirtualMethod () { } [ExpectedWarning ("IL2046", "ImplIRequiresMismatching.AbstractMethod", "IRequires.AbstractMethod")] - [ExpectedWarning ("IL3003", "ImplIRequiresMismatching.AbstractMethod", "IRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplIRequiresMismatching.AbstractMethod", "IRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplIRequiresMismatching.AbstractMethod", "IRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplIRequiresMismatching.AbstractMethod", "IRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void AbstractMethod () { } } class ImplINoRequiresMatching : INoRequires @@ -669,16 +669,16 @@ public static void AbstractMethod () { } class ImplINoRequiresMismatching : INoRequires { [ExpectedWarning ("IL2046", "ImplINoRequiresMismatching.VirtualMethod", "INoRequires.VirtualMethod")] - [ExpectedWarning ("IL3003", "ImplINoRequiresMismatching.VirtualMethod", "INoRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplINoRequiresMismatching.VirtualMethod", "INoRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplINoRequiresMismatching.VirtualMethod", "INoRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplINoRequiresMismatching.VirtualMethod", "INoRequires.VirtualMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.VirtualMethod--")] [RequiresAssemblyFiles ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.VirtualMethod--")] [RequiresDynamicCode ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.VirtualMethod--")] public static void VirtualMethod () { } [ExpectedWarning ("IL2046", "ImplINoRequiresMismatching.AbstractMethod", "INoRequires.AbstractMethod")] - [ExpectedWarning ("IL3003", "ImplINoRequiresMismatching.AbstractMethod", "INoRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3051", "ImplINoRequiresMismatching.AbstractMethod", "INoRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3003", "ImplINoRequiresMismatching.AbstractMethod", "INoRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3051", "ImplINoRequiresMismatching.AbstractMethod", "INoRequires.AbstractMethod", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.AbstractMethod--")] [RequiresAssemblyFiles ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.AbstractMethod--")] [RequiresDynamicCode ("Message for --StaticInterfaceMethods.ImplINoRequiresMatching.AbstractMethod--")] diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresInCompilerGeneratedCode.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresInCompilerGeneratedCode.cs index 62a41ffd041ad7..9d70adf9508ab8 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresInCompilerGeneratedCode.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresInCompilerGeneratedCode.cs @@ -52,8 +52,8 @@ public static void Main () class WarnInIteratorBody { [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static IEnumerable TestCallBeforeYieldReturn () { MethodWithRequires (); @@ -61,8 +61,8 @@ static IEnumerable TestCallBeforeYieldReturn () } [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static IEnumerable TestCallAfterYieldReturn () { yield return 0; @@ -100,8 +100,8 @@ static IEnumerable TestLdftn () // Cannot annotate fields either with RUC nor RAF therefore the warning persists [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static IEnumerable TestLazyDelegate () @@ -169,8 +169,8 @@ static IEnumerable TestLdftn () // Cannot annotate fields either with RUC nor RAF therefore the warning persists [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static IEnumerable TestLazyDelegate () @@ -236,8 +236,8 @@ public static void Test () class WarnInAsyncBody { [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static async void TestCallBeforeYieldReturn () { MethodWithRequires (); @@ -245,8 +245,8 @@ static async void TestCallBeforeYieldReturn () } [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static async void TestCallAfterYieldReturn () { await MethodAsync (); @@ -280,8 +280,8 @@ static async void TestLdftn () } [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static async void TestLazyDelegate () @@ -346,8 +346,8 @@ static async void TestLdftn () // Cannot annotate fields either with RUC nor RAF therefore the warning persists [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static async void TestLazyDelegate () @@ -411,8 +411,8 @@ public static void Test () class WarnInAsyncIteratorBody { [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static async IAsyncEnumerable TestCallBeforeYieldReturn () { await MethodAsync (); @@ -421,8 +421,8 @@ static async IAsyncEnumerable TestCallBeforeYieldReturn () } [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] static async IAsyncEnumerable TestCallAfterYieldReturn () { yield return 0; @@ -460,8 +460,8 @@ static async IAsyncEnumerable TestLdftn () } [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static async IAsyncEnumerable TestLazyDelegate () @@ -532,8 +532,8 @@ static async IAsyncEnumerable TestLdftn () // Cannot annotate fields either with RUC nor RAF therefore the warning persists [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static async IAsyncEnumerable TestLazyDelegate () @@ -606,14 +606,14 @@ static void TestCall () LocalFunction (); [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] void LocalFunction () => MethodWithRequires (); } [ExpectedWarning ("IL2026", "--LocalFunctionWithRequires--")] - [ExpectedWarning ("IL3002", "--LocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--LocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--LocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--LocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLocalFunctionWithRequires () { LocalFunction (); @@ -635,8 +635,8 @@ static void TestCallWithClosure (int p = 0) LocalFunction (); [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] void LocalFunction () { p++; @@ -685,8 +685,8 @@ void LocalFunction () } [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static void TestLazyDelegate () @@ -790,8 +790,8 @@ void LocalFunction () } [ExpectedWarning ("IL2026", "Message from --MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "Message from --MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static void TestLazyDelegate () @@ -1029,8 +1029,8 @@ void LocalFunction (Type unknownType = null) class TestSuppressionOnOuterWithSameName { [ExpectedWarning ("IL2026", nameof (Outer) + "()")] - [ExpectedWarning ("IL3002", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { Outer (); @@ -1094,14 +1094,14 @@ static void WarnInNonNestedLocalFunctionTest () LocalFunction (); [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void LocalFunction () => MethodWithRequires (); } [ExpectedWarning ("IL2026", "--MethodWithNonNestedLocalFunction--")] - [ExpectedWarning ("IL3002", "--MethodWithNonNestedLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithNonNestedLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithNonNestedLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithNonNestedLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void SuppressInNonNestedLocalFunctionTest () { MethodWithNonNestedLocalFunction (); @@ -1123,16 +1123,16 @@ static void TestCall () { Action lambda = [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] () => MethodWithRequires (); lambda (); } [ExpectedWarning ("IL2026", "--LambdaWithRequires--")] - [ExpectedWarning ("IL3002", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLambdaWithRequires () { Action lambda = @@ -1148,14 +1148,14 @@ static void TestCallUnused () { Action _ = [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] () => MethodWithRequires (); } [ExpectedWarning ("IL2026", "--LambdaWithRequires--")] - [ExpectedWarning ("IL3002", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--LambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLambdaWithRequiresUnused () { Action _ = @@ -1169,8 +1169,8 @@ static void TestCallWithClosure (int p = 0) { Action lambda = [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] () => { p++; MethodWithRequires (); @@ -1226,8 +1226,8 @@ static void TestLdftn () } [ExpectedWarning ("IL2026", "--MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static void TestLazyDelegate () @@ -1331,8 +1331,8 @@ static void TestLdftn () } [ExpectedWarning ("IL2026", "--MethodWithRequiresAndReturns--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequiresAndReturns--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] public static Lazy _default = new Lazy (MethodWithRequiresAndReturns); static void TestLazyDelegate () @@ -1441,8 +1441,8 @@ static void TestSuppressionOnOuterAndLambda () class TestSuppressionOnOuterWithSameName { [ExpectedWarning ("IL2026", nameof (Outer) + "()")] - [ExpectedWarning ("IL3002", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", nameof (Outer) + "()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { Outer (); @@ -1504,8 +1504,8 @@ static async void TestIteratorLocalFunctionInAsync () await MethodAsync (); [ExpectedWarning ("IL2026", "--MethodWithRequires--", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning", CompilerGeneratedCode = true)] IEnumerable LocalFunction () { yield return 0; @@ -1544,8 +1544,8 @@ IEnumerable IteratorLocalFunction () yield return 1; [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] void LocalFunction () => MethodWithRequires (); } } @@ -1562,8 +1562,8 @@ IEnumerable IteratorLocalFunction () } [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] void LocalFunction () => MethodWithRequires (); } @@ -1755,8 +1755,8 @@ static IEnumerable TestDynamicallyAccessedMethodViaGenericMethodParameterIn #endif [ExpectedWarning ("IL2026", "--IteratorLocalFunction--")] - [ExpectedWarning ("IL3002", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLocalFunctionInIteratorLocalFunction () { IteratorLocalFunction (); @@ -1780,8 +1780,8 @@ IEnumerable IteratorLocalFunction () } [ExpectedWarning ("IL2026", "--IteratorLocalFunction--")] - [ExpectedWarning ("IL3002", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--IteratorLocalFunction--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLocalFunctionCalledFromIteratorLocalFunctionAndMethod () { IteratorLocalFunction (); @@ -1799,8 +1799,8 @@ IEnumerable IteratorLocalFunction () } [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] void LocalFunction () => MethodWithRequires (); } @@ -1898,8 +1898,8 @@ public static void Test () class LocalFunctionsReferencedViaReflection { [ExpectedWarning ("IL2026", "--TestLocalFunctionWithRequires--")] - [ExpectedWarning ("IL3002", "--TestLocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--TestLocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--TestLocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--TestLocalFunctionWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLocalFunctionWithRequires () { LocalFunction (); @@ -1919,8 +1919,8 @@ static void TestLocalFunctionWithRequiresOnlyAccessedViaReflection () } [ExpectedWarning ("IL2026", "LocalFunction")] - [ExpectedWarning ("IL3002", "LocalFunction", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "LocalFunction", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "LocalFunction", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "LocalFunction", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLocalFunctionWithClosureWithRequires (int p = 0) { LocalFunction (); @@ -2009,8 +2009,8 @@ public static void Test () class LambdasReferencedViaReflection { [ExpectedWarning ("IL2026", "--TestLambdaWithRequires--")] - [ExpectedWarning ("IL3002", "--TestLambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--TestLambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--TestLambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--TestLambdaWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLambdaWithRequires () { var lambda = @@ -2023,8 +2023,8 @@ static void TestLambdaWithRequires () } [ExpectedWarning ("IL2026", "Lambda")] - [ExpectedWarning ("IL3002", "Lambda", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "Lambda", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "Lambda", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "Lambda", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestLambdaWithClosureWithRequires (int p = 0) { var lambda = @@ -2116,8 +2116,8 @@ static async Task AsyncMethodCallingRequires (Type type) } [ExpectedWarning ("IL2026", "ParentSuppression")] - [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { AsyncMethodCallingRequires (typeof (object)); @@ -2145,8 +2145,8 @@ static async Task AsyncMethodCallingRequires () } [ExpectedWarning ("IL2026", "ParentSuppression")] - [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { AsyncMethodCallingRequires (); @@ -2185,8 +2185,8 @@ static async IAsyncEnumerable CreateAsync () } [ExpectedWarning ("IL2026", "ParentSuppression")] - [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "ParentSuppression", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { AsyncEnumMethodCallingRequires (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs index 113119f1e4c739..293f34c1e2c05c 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnAttribute.cs @@ -64,16 +64,16 @@ public bool PropertyWhichRequires { } [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] class GenericTypeWithAttributedParameter<[AttributeWhichRequires] T> { public static void TestMethod () { } } [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void GenericMethodWithAttributedParameter<[AttributeWhichRequires] T> () { } static void TestRequiresOnAttributeOnGenericParameter () @@ -83,11 +83,11 @@ static void TestRequiresOnAttributeOnGenericParameter () } [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [AttributeWhichRequires] [AttributeWhichRequiresOnProperty (PropertyWhichRequires = true)] class TypeWithAttributeWhichRequires @@ -95,31 +95,31 @@ class TypeWithAttributeWhichRequires } [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [AttributeWhichRequires] [AttributeWhichRequiresOnProperty (PropertyWhichRequires = true)] static void MethodWithAttributeWhichRequires () { } [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [AttributeWhichRequires] [AttributeWhichRequiresOnProperty (PropertyWhichRequires = true)] static int _fieldWithAttributeWhichRequires; [ExpectedWarning ("IL2026", "--AttributeWhichRequiresAttribute.ctor--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresAttribute.ctor--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--")] - [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--AttributeWhichRequiresOnPropertyAttribute.PropertyWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [AttributeWhichRequires] [AttributeWhichRequiresOnProperty (PropertyWhichRequires = true)] static bool PropertyWithAttributeWhichRequires { get; set; } @@ -132,8 +132,8 @@ static void MethodWithAttributeWhichRequires () { } static void MethodWhichRequiresWithAttributeWhichRequires () { } [ExpectedWarning ("IL2026", "--MethodWhichRequiresWithAttributeWhichRequires--")] - [ExpectedWarning ("IL3002", "--MethodWhichRequiresWithAttributeWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWhichRequiresWithAttributeWhichRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWhichRequiresWithAttributeWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWhichRequiresWithAttributeWhichRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestMethodWhichRequiresWithAttributeWhichRequires () { MethodWhichRequiresWithAttributeWhichRequires (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnClass.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnClass.cs index da4fbcd59c330e..aaf55914f5ae0e 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnClass.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnClass.cs @@ -822,7 +822,7 @@ static void TestDAMAccessOnInstantiatedGeneric () [ExpectedWarning ("IL2026", "--TestDAMOnTypeAccessInRUCScope--")] [ExpectedWarning ("IL2026", "DAMAnnotatedClass.DAMAnnotatedClass()")] - [ExpectedWarning ("IL3050", "DAMAnnotatedClass.DAMAnnotatedClass()", Tool.NativeAot | Tool.Analyzer, "")] + [ExpectedWarning ("IL3050", "DAMAnnotatedClass.DAMAnnotatedClass()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { TestDAMAccess (); @@ -1211,7 +1211,7 @@ static void TestDAMOnTypeAccess (DAMAnnotatedClass instance) } [ExpectedWarning ("IL2026", "DAMAnnotatedClass.DAMAnnotatedClass()")] - [ExpectedWarning ("IL3050", "DAMAnnotatedClass.DAMAnnotatedClass()", Tool.NativeAot | Tool.Analyzer, "")] + [ExpectedWarning ("IL3050", "DAMAnnotatedClass.DAMAnnotatedClass()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { TestDAMAccess (); @@ -1238,7 +1238,7 @@ public int PropertyOnAttribute { [AttributeWithRequires (PropertyOnAttribute = 42)] [ExpectedWarning ("IL2026", "AttributeWithRequires.AttributeWithRequires()")] - [ExpectedWarning ("IL3050", "AttributeWithRequires.AttributeWithRequires()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "AttributeWithRequires.AttributeWithRequires()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void KeepFieldOnAttributeInner () { } static void KeepFieldOnAttribute () @@ -1436,7 +1436,7 @@ public static void Method () { } } [ExpectedWarning ("IL2026", "--ConstClassWithRequires--", nameof (ConstClassWithRequires.Method))] - [ExpectedWarning ("IL3050", "--ConstClassWithRequires--", nameof (ConstClassWithRequires.Method), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "--ConstClassWithRequires--", nameof (ConstClassWithRequires.Method), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestClassWithRequires () { var a = ConstClassWithRequires.Message; @@ -1455,7 +1455,7 @@ public static void Method () { } } [ExpectedWarning ("IL2026", "--ConstClassWithRequiresUsingField--", nameof (ConstClassWithRequiresUsingField.Method))] - [ExpectedWarning ("IL3050", "--ConstClassWithRequiresUsingField--", nameof (ConstClassWithRequiresUsingField.Method), Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3050", "--ConstClassWithRequiresUsingField--", nameof (ConstClassWithRequiresUsingField.Method), Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestClassUsingFieldInAttribute () { ConstClassWithRequiresUsingField.Method (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnStaticConstructor.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnStaticConstructor.cs index cfd8bfd9145f37..956f4ee494b0fc 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnStaticConstructor.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnStaticConstructor.cs @@ -30,8 +30,8 @@ public static void Main () class StaticCtor { [ExpectedWarning ("IL2026", "--MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2116", "StaticCtor..cctor()")] [RequiresUnreferencedCode ("Message for --TestStaticCtor--")] static StaticCtor () @@ -48,8 +48,8 @@ static void TestStaticCctorRequires () [RequiresUnreferencedCode ("Message for --StaticCtorOnTypeWithRequires--")] class StaticCtorOnTypeWithRequires { - [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static StaticCtorOnTypeWithRequires () => MethodWithRequires (); } @@ -118,8 +118,8 @@ static void TestStaticCtorMarkingIsTriggeredByFieldAccessOnExplicitLayout () class StaticCtorTriggeredByMethodCall { [ExpectedWarning ("IL2116", "StaticCtorTriggeredByMethodCall..cctor()")] - [ExpectedWarning ("IL3004", "StaticCtorTriggeredByMethodCall..cctor()", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3056", "StaticCtorTriggeredByMethodCall..cctor()", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3004", "StaticCtorTriggeredByMethodCall..cctor()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3056", "StaticCtorTriggeredByMethodCall..cctor()", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [RequiresUnreferencedCode ("Message for --StaticCtorTriggeredByMethodCall.Cctor--")] [RequiresAssemblyFiles ("Message for --StaticCtorTriggeredByMethodCall.Cctor--")] [RequiresDynamicCode ("Message for --StaticCtorTriggeredByMethodCall.Cctor--")] @@ -137,8 +137,8 @@ public void TriggerStaticCtorMarking () [ExpectedWarning ("IL2026", "--StaticCtorTriggeredByMethodCall.TriggerStaticCtorMarking--")] - [ExpectedWarning ("IL3002", "--StaticCtorTriggeredByMethodCall.TriggerStaticCtorMarking--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--StaticCtorTriggeredByMethodCall.TriggerStaticCtorMarking--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--StaticCtorTriggeredByMethodCall.TriggerStaticCtorMarking--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--StaticCtorTriggeredByMethodCall.TriggerStaticCtorMarking--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestStaticCtorTriggeredByMethodCall () { new StaticCtorTriggeredByMethodCall ().TriggerStaticCtorMarking (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnVirtualsAndInterfaces.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnVirtualsAndInterfaces.cs index 4623dd6355fc1f..c7c937e7ebb9e9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnVirtualsAndInterfaces.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresOnVirtualsAndInterfaces.cs @@ -46,8 +46,8 @@ public override void VirtualMethodRequires () } [ExpectedWarning ("IL2026", "--BaseType.VirtualMethodRequires--")] - [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestCallOnBase () { var tmp = new BaseType (); @@ -55,8 +55,8 @@ static void TestCallOnBase () } [ExpectedWarning ("IL2026", "--BaseType.VirtualMethodRequires--")] - [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestCallOnOverride () { var tmp = new TypeWhichOverridesMethod (); @@ -64,8 +64,8 @@ static void TestCallOnOverride () } [ExpectedWarning ("IL2026", "--BaseType.VirtualMethodRequires--")] - [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--BaseType.VirtualMethodRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestCallOnOverrideViaBase () { BaseType tmp = new TypeWhichOverridesMethod (); @@ -133,8 +133,8 @@ public override int VirtualPropertyRequires { } [ExpectedWarning ("IL2026", "--PropertyBaseType.VirtualPropertyRequires--")] - [ExpectedWarning ("IL3002", "--PropertyBaseType.VirtualPropertyRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--PropertyBaseType.VirtualPropertyRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--PropertyBaseType.VirtualPropertyRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--PropertyBaseType.VirtualPropertyRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void CallOnDerived () { var tmp = new TypeWhichOverridesProperty (); @@ -171,8 +171,8 @@ public void MethodWithRequires () } [ExpectedWarning ("IL2026", "--IRequires.MethodWithRequires--")] - [ExpectedWarning ("IL3002", "--IRequires.MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--IRequires.MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--IRequires.MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--IRequires.MethodWithRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestCallViaInterface () { IRequires inst = new ImplementationClass (); @@ -180,8 +180,8 @@ static void TestCallViaInterface () } [ExpectedWarning ("IL2026", "--ImplementationClass.RequiresMethod--")] - [ExpectedWarning ("IL3002", "--ImplementationClass.RequiresMethod--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--ImplementationClass.RequiresMethod--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--ImplementationClass.RequiresMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--ImplementationClass.RequiresMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestCallViaImplementationClass () { ImplementationClass inst = new ImplementationClass (); @@ -240,8 +240,8 @@ public override DerivedReturnType GetRequires () } [ExpectedWarning ("IL2026", "--CovariantReturnDerived.GetRequires--")] - [ExpectedWarning ("IL3002", "--CovariantReturnDerived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--CovariantReturnDerived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--CovariantReturnDerived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--CovariantReturnDerived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void CallOnDerived () { var tmp = new CovariantReturnDerived (); @@ -276,8 +276,8 @@ public override DerivedReturnType GetRequires () } [ExpectedWarning ("IL2026", "--CovariantReturnViaLdftn.Derived.GetRequires--")] - [ExpectedWarning ("IL3002", "--CovariantReturnViaLdftn.Derived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--CovariantReturnViaLdftn.Derived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--CovariantReturnViaLdftn.Derived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--CovariantReturnViaLdftn.Derived.GetRequires--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] public static void Test () { var tmp = new Derived (); @@ -343,11 +343,11 @@ public static void AbstractMethod () { } } [ExpectedWarning ("IL2026", "--StaticInterfaces.IRequires.VirtualMethod--")] - [ExpectedWarning ("IL3002", "--StaticInterfaces.IRequires.VirtualMethod--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--StaticInterfaces.IRequires.VirtualMethod--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--StaticInterfaces.IRequires.VirtualMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--StaticInterfaces.IRequires.VirtualMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] [ExpectedWarning ("IL2026", "--StaticInterfaces.IRequires.AbstractMethod--")] - [ExpectedWarning ("IL3002", "--StaticInterfaces.IRequires.AbstractMethod--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--StaticInterfaces.IRequires.AbstractMethod--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--StaticInterfaces.IRequires.AbstractMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--StaticInterfaces.IRequires.AbstractMethod--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void UseRequiresMethods () where T : IRequires { T.AbstractMethod (); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresWithCopyAssembly.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresWithCopyAssembly.cs index e935d941878588..60435836c05ade 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresWithCopyAssembly.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/RequiresCapability/RequiresWithCopyAssembly.cs @@ -42,8 +42,8 @@ public static void Main () } [ExpectedWarning ("IL2026", "--Method--")] - [ExpectedWarning ("IL3002", "--Method--", Tool.Analyzer | Tool.NativeAot, "")] - [ExpectedWarning ("IL3050", "--Method--", Tool.Analyzer | Tool.NativeAot, "")] + [ExpectedWarning ("IL3002", "--Method--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] + [ExpectedWarning ("IL3050", "--Method--", Tool.Analyzer | Tool.NativeAot, "NativeAOT-specific warning")] static void TestRequiresInMethodFromCopiedAssembly () { var tmp = new RequiresInCopyAssembly (); From 1c4276bd07a94b11f0fae868d9c8b510b7c8bcb7 Mon Sep 17 00:00:00 2001 From: Jackson Schuster <36744439+jtschuster@users.noreply.github.com> Date: Mon, 30 Jun 2025 13:35:35 -0700 Subject: [PATCH 3/3] PR Feedback --- .../DataFlow/CompilerGeneratedCodeDataflow.cs | 12 +- .../DataFlow/ExceptionalDataFlow.cs | 154 +++++++++--------- .../DetectRedundantSuppressionsFromXML.cs | 4 +- 3 files changed, 85 insertions(+), 85 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs index e57d2e5e12e5b6..e8c94f3b7b5cbc 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/CompilerGeneratedCodeDataflow.cs @@ -38,8 +38,8 @@ static IEnumerable FlowAcrossYieldReturn() } // Trimmer tracks all assignments of hoisted locals, so this produces warnings. - [UnexpectedWarning("IL2072", nameof(GetWithPublicMethods), nameof(DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] - [UnexpectedWarning("IL2072", [nameof(GetWithPublicFields), nameof(DataFlowTypeExtensions.RequiresPublicMethods)], Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] + [UnexpectedWarning("IL2072", nameof(GetWithPublicMethods), nameof(DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117155", CompilerGeneratedCode = true)] + [UnexpectedWarning("IL2072", [nameof(GetWithPublicFields), nameof(DataFlowTypeExtensions.RequiresPublicMethods)], Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117155", CompilerGeneratedCode = true)] static IEnumerable NoFlowAcrossYieldReturn() { Type t = GetWithPublicMethods(); @@ -226,8 +226,8 @@ static async void FlowAcrossAwait() } // Trimmer tracks all assignments of hoisted locals, so this produces warnings. - [ExpectedWarning("IL2072", nameof(GetWithPublicMethods), nameof(DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] - [ExpectedWarning("IL2072", nameof(GetWithPublicFields), nameof(DataFlowTypeExtensions.RequiresPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/linker/issues/2862", CompilerGeneratedCode = true)] + [ExpectedWarning("IL2072", nameof(GetWithPublicMethods), nameof(DataFlowTypeExtensions.RequiresPublicFields), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117155", CompilerGeneratedCode = true)] + [ExpectedWarning("IL2072", nameof(GetWithPublicFields), nameof(DataFlowTypeExtensions.RequiresPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117155", CompilerGeneratedCode = true)] static async void NoFlowAcrossAwait() { Type t = GetWithPublicMethods(); @@ -454,7 +454,7 @@ public static void ReadCapturedParameterAfterWrite(Type tParameter = null) void LocalFunction() => tParameter.RequiresPublicMethods(); } - [ExpectedWarning("IL2072", ["tParameter", nameof(GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/linker/issues/2862")] + [ExpectedWarning("IL2072", ["tParameter", nameof(GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117155")] public static void ReadCapturedParameterAfterWriteMismatch([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type tParameter = null) { tParameter = GetWithPublicFields(); @@ -585,7 +585,7 @@ public static void ReadCapturedParameterAfterWrite(Type tParameter = null) lambda(); } - [ExpectedWarning("IL2072", ["tParameter", nameof(GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/linker/issues/2862")] + [ExpectedWarning("IL2072", ["tParameter", nameof(GetWithPublicFields)], Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117155")] public static void ReadCapturedParameterAfterWriteMismatch([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type tParameter = null) { tParameter = GetWithPublicFields(); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs index 8ce63cbc776025..d434db1fd3fca9 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/ExceptionalDataFlow.cs @@ -46,8 +46,8 @@ public static void Main() ExceptionFilterWithException(); } - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void TryFlowsToFinally() { @@ -120,9 +120,9 @@ public static void MultipleTryExits() // On each path, only one state is possible, but we conservatively merge the (non-exceptional) // finally states for each path and expect the warnings to reflect this merged state. [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] @@ -132,9 +132,9 @@ public static void MultipleTryExits() [ExpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicEvents) + "()")] // Trimmer merges branches going forward. - [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [UnexpectedWarning("IL2073", nameof(MultipleFinallyPaths) + "()", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] [return: DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] public static Type MultipleFinallyPaths() { @@ -172,11 +172,11 @@ public static Type MultipleFinallyPaths() throw new Exception(); } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void FinallyChain() { @@ -199,12 +199,12 @@ public static void FinallyChain() } } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicProperties) + "()")] @@ -235,8 +235,8 @@ public static void FinallyChainWithPostFinallyState() RequireAll4(t); } - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void TryFlowsToCatch() { @@ -253,8 +253,8 @@ public static void TryFlowsToCatch() } } - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void CatchFlowsToFinally() { @@ -274,7 +274,7 @@ public static void CatchFlowsToFinally() } } - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void CatchFlowsToAfterTry() { @@ -291,7 +291,7 @@ public static void CatchFlowsToAfterTry() RequireAll(t); } - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void CatchFlowsToAfterFinally() { @@ -332,17 +332,17 @@ public class Exception2 : Exception { } [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll5) + "(Type)", nameof(GetWithPublicEvents) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicEvents) + "()")] @@ -352,16 +352,16 @@ public class Exception2 : Exception { } [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicConstructors) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll5) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll5) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll5) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll5) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll7) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void TryFlowsToMultipleCatchAndFinally() { @@ -393,15 +393,15 @@ public static void TryFlowsToMultipleCatchAndFinally() } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicConstructors) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicConstructors) + "()")] public static void NestedWithFinally() @@ -432,14 +432,14 @@ public static void NestedWithFinally() } } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicEvents) + "()")] @@ -476,16 +476,16 @@ public static void ControlFlowsOutOfMultipleFinally() } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicConstructors) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicEvents) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicConstructors) + "()")] public static void NestedWithCatch() @@ -518,7 +518,7 @@ public static void NestedWithCatch() [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void CatchInTry() { try @@ -548,7 +548,7 @@ public static void CatchInTry() // [ExpectedSharedWarning ("IL2072", nameof (RequireAll2) + "(Type)", nameof (GetWithPublicConstructors) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void CatchInTryWithFinally() { Type t = GetWithPublicConstructors(); @@ -582,10 +582,10 @@ public static void CatchInTryWithFinally() } } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicConstructors) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] static void CatchInFinally() @@ -612,7 +612,7 @@ static void CatchInFinally() [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void TestCatchesHaveSeparateState() { Type t = GetWithPublicMethods(); @@ -634,7 +634,7 @@ public static void TestCatchesHaveSeparateState() } [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] public static void FinallyWithBranchToFirstBlock() { Type t = GetWithPublicMethods(); @@ -651,7 +651,7 @@ public static void FinallyWithBranchToFirstBlock() } [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] public static void FinallyWithBranchToFirstBlockAndEnclosingTryCatchState() { try @@ -679,7 +679,7 @@ public static void FinallyWithBranchToFirstBlockAndEnclosingTryCatchState() } [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] public static void CatchWithBranchToFirstBlock() { Type t = GetWithPublicMethods(); @@ -696,7 +696,7 @@ public static void CatchWithBranchToFirstBlock() } [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] public static void CatchWithBranchToFirstBlockAndReassignment() { Type t = GetWithPublicMethods(); @@ -715,8 +715,8 @@ public static void CatchWithBranchToFirstBlockAndReassignment() [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void CatchWithNonSimplePredecessor() { @@ -744,8 +744,8 @@ public static void CatchWithNonSimplePredecessor() [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void FinallyWithNonSimplePredecessor() { @@ -773,8 +773,8 @@ public static void FinallyWithNonSimplePredecessor() [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicProperties) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] public static void FinallyInTryWithPredecessor() { @@ -800,17 +800,17 @@ public static void FinallyInTryWithPredecessor() } } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void NestedFinally() { Type t = GetWithPublicMethods(); @@ -839,8 +839,8 @@ public static void NestedFinally() [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll4) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void ChangeInFinallyNestedInFinally() { Type t = GetWithPublicMethods(); @@ -863,17 +863,17 @@ public static void ChangeInFinallyNestedInFinally() RequireAll4(t); // fields only } - [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll1) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties) + "()")] [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll3) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void NestedFinallyWithPredecessor() { Type t = GetWithPublicMethods(); @@ -897,9 +897,9 @@ public static void NestedFinallyWithPredecessor() } } - [ExpectedWarning("IL2072", nameof(RequireAllTrue) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAllTrue) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAllTrue) + "(Type)", nameof(GetWithPublicFields) + "()")] - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/117157")] [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicFields) + "()")] public static void ExceptionFilter() { @@ -920,7 +920,7 @@ public static void ExceptionFilter() [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void ExceptionFilterStateChange() { Type t = GetWithPublicMethods(); @@ -963,9 +963,9 @@ public static void ExceptionFilterStateChange() [ExpectedWarning("IL2072", nameof(RequireAll6) + "(Type)", nameof(GetWithPublicProperties) + "()")] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] - [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicMethods) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] + [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicFields) + "()", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void ExceptionMultipleFilters() { Type t = GetWithPublicMethods(); @@ -1007,7 +1007,7 @@ public static void ExceptionMultipleFilters() [ExpectedWarning("IL2072", nameof(RequireAll2) + "(Type)", nameof(GetWithPublicProperties))] // Trimmer merges branches going forward. - [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/102830")] + [ExpectedWarning("IL2072", nameof(RequireAll) + "(Type)", nameof(GetWithPublicMethods), Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/117157")] public static void ExceptionFilterWithBranch() { Type t = GetWithPublicMethods(); diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs index 2366d5ae8a10a8..23fcf687db3bd0 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Warnings/WarningSuppression/DetectRedundantSuppressionsFromXML.cs @@ -8,8 +8,8 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression { [SkipKeptItemsValidation] [ExpectedNoWarnings] - [ExpectedWarning("IL2121", "IL2026", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 7)] - [ExpectedWarning("IL2121", "IL2109", Tool.Trimmer, "https://github.com/dotnet/linker/issues/1971", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 12)] + [ExpectedWarning("IL2121", "IL2026", Tool.Trimmer, "https://github.com/dotnet/runtime/issues/117170", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 7)] + [ExpectedWarning("IL2121", "IL2109", Tool.Trimmer, "https://github.com/dotnet/runtime/issues/117170", FileName = "DetectRedundantSuppressionsFromXML.xml", SourceLine = 12)] [SetupLinkAttributesFile("DetectRedundantSuppressionsFromXML.xml")] public class DetectRedundantSuppressionsFromXML {