diff options
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/ReturnValueDowncastedToInterface.cs')
-rw-r--r-- | linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/ReturnValueDowncastedToInterface.cs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/ReturnValueDowncastedToInterface.cs b/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/ReturnValueDowncastedToInterface.cs new file mode 100644 index 000000000..0aef967a5 --- /dev/null +++ b/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/ReturnValueDowncastedToInterface.cs @@ -0,0 +1,30 @@ +using Mono.Linker.Tests.Cases.Expectations.Assertions; + +namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded { + public class ReturnValueDowncastedToInterface { + public static void Main () + { + UseAnIFoo (GetAFoo ()); + } + + [Kept] + static Foo GetAFoo () + { + return null; + } + + [Kept] + static void UseAnIFoo (IFoo arg) + { + } + + [Kept] + [KeptInterface (typeof (IFoo))] + class Foo : IFoo { + } + + [Kept] + interface IFoo { + } + } +}
\ No newline at end of file |