blob: 03a7e8fee88e1d0ad35034a85ae7764d80ffcd43 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
using System.Runtime.CompilerServices;
using System.Diagnostics.CodeAnalysis;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces.OnReferenceType.NoKeptCtor
{
/// <summary>
/// The interface can still be removed in this case because PreserveDependency is just preserving Foo() on the current type
/// </summary>
public class DynamicDependencyPreservesInterfaceMethod
{
public static void Main ()
{
StaticMethodOnlyUsed.StaticMethod ();
}
interface IUnusedInterface
{
void Foo ();
}
[Kept]
class StaticMethodOnlyUsed : IUnusedInterface
{
[Kept]
public void Foo ()
{
}
[Kept]
[DynamicDependency ("Foo")]
public static void StaticMethod ()
{
}
}
}
}
|