diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Inheritance.AbstractClasses/NoKeptCtor/OverrideRemoval/PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Inheritance.AbstractClasses/NoKeptCtor/OverrideRemoval/PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2.cs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Inheritance.AbstractClasses/NoKeptCtor/OverrideRemoval/PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2.cs b/test/Mono.Linker.Tests.Cases/Inheritance.AbstractClasses/NoKeptCtor/OverrideRemoval/PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2.cs new file mode 100644 index 000000000..a1ddd7c30 --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/Inheritance.AbstractClasses/NoKeptCtor/OverrideRemoval/PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2.cs @@ -0,0 +1,60 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Inheritance.AbstractClasses.NoKeptCtor.OverrideRemoval { + public class PreservesOverriddenMethodOverrideOfUsedVirtualStillRemoved2 { + public static void Main () + { + Base j = new Jar (); + j.One (); + } + + [Kept] + [KeptMember (".ctor()")] + abstract class Base { + [Kept] + public abstract void Foo (); + + [Kept] + public abstract void One (); + } + + [Kept] + [KeptMember (".ctor()")] + [KeptBaseType (typeof (Base))] + abstract class Base2 : Base + { + [Kept] + public override void One () + { + } + } + + [Kept] + [KeptBaseType (typeof (Base2))] + class Bar : Base2 { + [Kept] + public override void Foo () + { + } + + public override void One () + { + } + } + + [Kept] + [KeptMember (".ctor()")] + [KeptBaseType (typeof (Base2))] + class Jar : Base2 { + [Kept] + public override void Foo () + { + } + + [Kept] + public override void One () + { + } + } + } +}
\ No newline at end of file |