blob: 0813d2935e2eed473717f1879c4a9efa499a940f (
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
|
// Compiler options: -warn:4 -warnaserror
using System;
// Nothing wrong with this, gmcs says otherwise
// Class is generic
public class TestGeneric<T>
{
public event EventHandler Event;
public void Raise ()
{
Event (this, EventArgs.Empty);
}
}
// Nothing wrong with this, gmcs concurs
// Note that T is used in the delegate signature for Event
public class TestGeneric2<T>
{
public delegate void GenericHandler (T t);
public event GenericHandler Event;
public void Raise ()
{
Event (default (T));
}
}
// Nothing wrong with this, gmcs concurs
// Class is not generic
public class Test
{
public event EventHandler Event;
public void Raise ()
{
Event (this, EventArgs.Empty);
}
public static void Main ()
{
}
}
|