blob: 099b92ab27341eeb4e9cb0740f33b5e17bcc84e1 (
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
46
47
48
49
50
51
52
53
|
using System;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
namespace Mono.Linker.Tests.Cases.Basic
{
[KeptDelegateCacheField ("0")]
class UsedEventOnInterfaceIsKept
{
static void Main ()
{
IFoo bar = new Bar ();
IFoo jar = new Jar ();
bar.Ping += Bar_Ping;
}
[Kept]
private static void Bar_Ping (object sender, EventArgs e)
{
}
[Kept]
interface IFoo
{
[Kept]
[KeptEventAddMethod]
[KeptEventRemoveMethod]
event EventHandler Ping;
}
[KeptMember (".ctor()")]
[KeptInterface (typeof (IFoo))]
class Bar : IFoo
{
[Kept]
[KeptBackingField]
[KeptEventAddMethod]
[KeptEventRemoveMethod]
public event EventHandler Ping;
}
[KeptMember (".ctor()")]
[KeptInterface (typeof (IFoo))]
class Jar : IFoo
{
[Kept]
[KeptBackingField]
[KeptEventAddMethod]
[KeptEventRemoveMethod]
public event EventHandler Ping;
}
}
}
|