blob: 9c1cd8ed8eade0a9db756d925c09a78e85e58666 (
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
|
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
namespace Mono.Linker.Tests.Cases.DataFlow
{
public class DynamicDependencyDataflow
{
public static void Main ()
{
DynamicDependencyFrom ();
}
[Kept]
[KeptAttributeAttribute (typeof (DynamicallyAccessedMembersAttribute))]
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicMethods)]
static Type TypeWithPublicMethods;
[Kept]
[UnrecognizedReflectionAccessPattern (typeof (Type), "GetField", new Type[] { typeof (string) }, messageCode: "IL2080")]
[DynamicDependency ("DynamicDependencyTo")]
static void DynamicDependencyFrom ()
{
_ = TypeWithPublicMethods.GetField ("f");
}
[Kept]
[UnrecognizedReflectionAccessPattern (typeof (Type), "GetProperty", new Type[] { typeof (string) }, messageCode: "IL2080")]
static void DynamicDependencyTo ()
{
_ = TypeWithPublicMethods.GetProperty ("p");
}
}
}
|