diff options
Diffstat (limited to 'test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept.cs')
-rw-r--r-- | test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept.cs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept.cs b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept.cs new file mode 100644 index 000000000..95fd8b266 --- /dev/null +++ b/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept.cs @@ -0,0 +1,38 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType { + public class ObjectCastedToSecondInterfaceHasMemberRemovedButInterfaceKept { + public static void Main () + { + IFoo i = new A (); + i.Foo (); + var b = (IBar) i; + } + + [Kept] + interface IFoo { + [Kept] + void Foo (); + } + + [Kept] + interface IBar { + void Bar (); + } + + [Kept] + [KeptMember (".ctor()")] + [KeptInterface (typeof (IFoo))] + [KeptInterface (typeof (IBar))] + class A : IBar, IFoo { + [Kept] + public void Foo () + { + } + + public void Bar () + { + } + } + } +}
\ No newline at end of file |