From 2c56d90d3fefb052f1126eef86742a7b598744d7 Mon Sep 17 00:00:00 2001 From: Aleksey Kliger Date: Thu, 17 Mar 2022 15:25:25 -0400 Subject: [PATCH] make the Browser EAT lanes happy Add some fields to the baseline versions of some test assemblies to keep some types that are used in the deltas from getting trimmed away --- .../AddNestedClass.cs | 4 ++++ .../AddNestedClass_v1.cs | 4 ++++ .../ReflectionAddNewType.cs | 15 ++++++++++++++- .../ReflectionAddNewType_v1.cs | 15 ++++++++++++++- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass.cs index d5bd6ce27fd0e..277098ffc77ff 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass.cs @@ -7,6 +7,10 @@ namespace System.Reflection.Metadata.ApplyUpdate.Test { public class AddNestedClass { + public static Action X; // make the linker happy + public static Delegate Y; + public event Action Evt; + public void R () { Evt ("123"); } public AddNestedClass() { } diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass_v1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass_v1.cs index fa8f5ed30b564..fcca03192d58a 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass_v1.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddNestedClass/AddNestedClass_v1.cs @@ -7,6 +7,10 @@ namespace System.Reflection.Metadata.ApplyUpdate.Test { public class AddNestedClass { + public static Action X; // make the linker happy + public static Delegate Y; + public event Action Evt; + public void R () { Evt ("123"); } public AddNestedClass() { } diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType.cs index 23c961bd9697e..7d720e44585f3 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType.cs @@ -9,9 +9,22 @@ public interface IExistingInterface { public string ItfMethod(int i); } +public struct QExistingStruct +{ +} + +public enum FExistingEnum { + One, Two +} + public class ZExistingClass { - public class PreviousNestedClass { } + public class PreviousNestedClass { + public static DateTime Now; // make the linker happy + public static ICloneable C; + public event EventHandler E; + public void R() { E(this,"123"); } + } } [AttributeUsage(AttributeTargets.All, AllowMultiple=true, Inherited=false)] diff --git a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType_v1.cs b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType_v1.cs index 107f3b72c68bc..02762f11f0512 100644 --- a/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType_v1.cs +++ b/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.ReflectionAddNewType/ReflectionAddNewType_v1.cs @@ -9,9 +9,22 @@ public interface IExistingInterface { public string ItfMethod(int i); } +public struct QExistingStruct +{ +} + +public enum FExistingEnum { + One, Two +} + public class ZExistingClass { - public class PreviousNestedClass { } + public class PreviousNestedClass { + public static DateTime Now; // make the linker happy + public static ICloneable C; + public event EventHandler E; + public void R() { E(this,"123"); } + } public class NewNestedClass {};