blob: edff204d60248104382ec92d633db0a1cf8c2006 (
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;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
namespace Mono.Linker.Tests.Cases.Basic {
[KeptDelegateCacheField ("0")]
class UsedEventOnInterfaceIsRemovedWhenUsedFromClass {
static void Main ()
{
var bar = new Bar ();
var jar = new Jar ();
bar.Ping += Bar_Ping;
}
[Kept]
private static void Bar_Ping (object sender, EventArgs e)
{
}
interface IFoo {
event EventHandler Ping;
}
[KeptMember (".ctor()")]
class Bar : IFoo {
[Kept]
[KeptBackingField]
[KeptEventAddMethod]
[KeptEventRemoveMethod]
public event EventHandler Ping;
}
[KeptMember (".ctor()")]
class Jar : IFoo {
public event EventHandler Ping;
}
}
}
|