blob: f0201bbda3e4cefa3e2c291b194b2d1e3e475481 (
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
39
40
41
42
43
44
45
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
namespace Mono.Linker.Tests.Cases.Reflection
{
public class TypeBaseTypeUseViaReflection
{
public static void Main ()
{
KnownType_Derived.Test ();
}
[Kept]
class KnownType_Base
{
[Kept]
public KnownType_Base () { }
[Kept]
private static void UsedViaReflection () { }
private static void Unused () { }
}
[Kept]
[KeptBaseType (typeof (KnownType_Base))]
class KnownType_Derived : KnownType_Base
{
[Kept]
public static void Test ()
{
typeof (KnownType_Derived).BaseType.GetMethod ("UsedViaReflection", BindingFlags.NonPublic | BindingFlags.Static);
typeof (KnownType_Derived).BaseType.GetConstructor (Type.EmptyTypes);
}
}
}
}
|