From e79a5cbf2402e917d749b52003cdf1e52a4c6dc0 Mon Sep 17 00:00:00 2001 From: Charles Stoner <10732005+cston@users.noreply.github.com> Date: Fri, 27 Sep 2024 12:54:19 -0700 Subject: [PATCH 1/4] Update field references in property accessors --- src/tools/illink/test/ILLink.Tasks.Tests/Mock.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/illink/test/ILLink.Tasks.Tests/Mock.cs b/src/tools/illink/test/ILLink.Tasks.Tests/Mock.cs index 9a640c05b9f4c..9b8d10c6fde12 100644 --- a/src/tools/illink/test/ILLink.Tasks.Tests/Mock.cs +++ b/src/tools/illink/test/ILLink.Tasks.Tests/Mock.cs @@ -37,8 +37,8 @@ public MockDriver CreateDriver () public static string[] OptimizationNames { get { - var field = typeof (ILLink).GetField ("_optimizationNames", BindingFlags.NonPublic | BindingFlags.Static); - return (string[]) field.GetValue (null); + var fieldInfo = typeof (ILLink).GetField ("_optimizationNames", BindingFlags.NonPublic | BindingFlags.Static); + return (string[]) fieldInfo.GetValue (null); } } From 7ab488b44dff869c8e60e13b8dc3ff5f095ff7d5 Mon Sep 17 00:00:00 2001 From: Charles Stoner <10732005+cston@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:21:00 -0700 Subject: [PATCH 2/4] Update field references --- .../Reflection/MemberUsedViaReflection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs index 9ddc8fa45debe..212bdadf0bbce 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs @@ -144,9 +144,9 @@ private class SimpleType [Kept] public int memberKept { [Kept] - get { return field; } + get { return this.field; } [Kept] - set { field = value; } + set { this.field = value; } } [Kept] @@ -508,4 +508,4 @@ public static class PrefixLookupNestedType { } private static class PrefixLookupPrivateNestedType { } } } -} \ No newline at end of file +} From 6c66d20138318cdde5cc270d1d921adb97633c6d Mon Sep 17 00:00:00 2001 From: Charles Stoner <10732005+cston@users.noreply.github.com> Date: Tue, 1 Oct 2024 20:33:39 -0700 Subject: [PATCH 3/4] Use @ --- .../Reflection/MemberUsedViaReflection.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs index 212bdadf0bbce..ba17ad6b8147f 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs @@ -144,9 +144,9 @@ private class SimpleType [Kept] public int memberKept { [Kept] - get { return this.field; } + get { return @field; } [Kept] - set { this.field = value; } + set { @field = value; } } [Kept] From bd68aecba3a61c2955214bf5a5dfdaa9bd5d7310 Mon Sep 17 00:00:00 2001 From: Charles Stoner <10732005+cston@users.noreply.github.com> Date: Wed, 2 Oct 2024 06:52:15 -0700 Subject: [PATCH 4/4] Rename field --- .../Reflection/MemberUsedViaReflection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs index ba17ad6b8147f..0a33e4e81e9d8 100644 --- a/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Reflection/MemberUsedViaReflection.cs @@ -139,14 +139,14 @@ static void TestIfElse (bool decision) private class SimpleType { [Kept] - public static int field; + public static int fieldKept; [Kept] public int memberKept { [Kept] - get { return @field; } + get { return fieldKept; } [Kept] - set { @field = value; } + set { fieldKept = value; } } [Kept]