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