Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/LocalDowncastedToInterface.cs')
-rw-r--r--linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/LocalDowncastedToInterface.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/LocalDowncastedToInterface.cs b/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/LocalDowncastedToInterface.cs
new file mode 100644
index 000000000..dc63d99a3
--- /dev/null
+++ b/linker/Tests/Mono.Linker.Tests.Cases/Inheritance.Interfaces/OnReferenceType/NoKeptCtorButInterfaceNeeded/LocalDowncastedToInterface.cs
@@ -0,0 +1,27 @@
+using Mono.Linker.Tests.Cases.Expectations.Assertions;
+
+namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoKeptCtorButInterfaceNeeded {
+ public class LocalDowncastedToInterface {
+ public static void Main ()
+ {
+ Foo f = null;
+ IFoo i = f;
+ i.Method ();
+ }
+
+ [Kept]
+ [KeptInterface (typeof (IFoo))]
+ class Foo : IFoo {
+ [Kept] // TODO : It should be safe to stub this. It can't actually be called because no instance of Foo ever exists
+ public void Method ()
+ {
+ }
+ }
+
+ [Kept]
+ interface IFoo {
+ [Kept]
+ void Method ();
+ }
+ }
+} \ No newline at end of file