From a64d6905eb7bcc9610b8fad01b22e1faabd7d963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 9 Apr 2025 09:36:11 +0200 Subject: [PATCH 1/5] Baseline new warning in trimming tests ToolsTests legs are failing: https://github.com/dotnet/runtime/pull/114406#issuecomment-2788504319 Psychic debugging (without actually trying to repro anything) tells me this is from #114346 that makes us emit more dynamic keyword warnings. That PR didn't trigger the ToolsTests leg since it's not a ILLink change. --- .../test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs index d334b99439d96c..38a2db41c04d84 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs @@ -129,6 +129,7 @@ class DynamicInRequiresUnreferencedCodeClass [RequiresUnreferencedCode("message")] class ClassWithRequires { + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] public static void MethodWithDynamicArg (dynamic arg) { From eab77cd6dbaec6a19f0a54ae759e1679bcae238d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 9 Apr 2025 10:16:44 +0200 Subject: [PATCH 2/5] Add duplicate ExpectedWarning attribute in DynamicIndexerAccess --- .../test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs index 38a2db41c04d84..b7265f70f7ac66 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs @@ -105,6 +105,7 @@ class DynamicIndexerAccess { [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.GetIndex")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void Read (dynamic d) { var x = d[0]; From 1e7b3ac90bbe2ce17f298f48f4ca4358e88e1526 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 9 Apr 2025 02:38:10 -0700 Subject: [PATCH 3/5] Add duplicate ExpectedWarning attribute in DynamicObjects.cs --- .../test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs index b7265f70f7ac66..324119bfca4936 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs @@ -113,6 +113,7 @@ static void Read (dynamic d) [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.SetIndex")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void Write (dynamic d) { d[0] = 0; From f20eca0a7c11a4d58e5eafefad39054e5e5a5cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 9 Apr 2025 03:49:22 -0700 Subject: [PATCH 4/5] Add duplicate ExpectedWarning attributes in DynamicObjects.cs --- .../test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs index 324119bfca4936..07ed9e0c37e2ba 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs @@ -82,6 +82,7 @@ class DynamicMemberReference { [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.GetMember")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void Read (dynamic d) { var x = d.Member; @@ -89,6 +90,7 @@ static void Read (dynamic d) [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.SetMember")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void Write (dynamic d) { d.Member = 0; From 24ed1133c9f0657185a2d7af58cf37e1ecbca7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 9 Apr 2025 20:44:02 +0900 Subject: [PATCH 5/5] Update DynamicObjects.cs --- .../test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs index 07ed9e0c37e2ba..bb32cab99d62b1 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/DataFlow/DynamicObjects.cs @@ -30,6 +30,7 @@ class InvocationOnDynamicType { [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void DynamicArgument () { dynamic dynamicObject = "Some string"; @@ -49,6 +50,7 @@ static void MethodWithDynamicParameterDoNothing (dynamic arg) [ExpectedWarning ("IL2026", "Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember")] [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] + [ExpectedWarning ("IL3050", Tool.NativeAot, "https://github.com/dotnet/runtime/issues/94427")] static void MethodWithDynamicParameter (dynamic arg) { arg.MethodWithDynamicParameter (arg);