blob: 71439f79faa9c237fcf1fbf76ce187a9f0dd10aa (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
// This code must be compilable without any warning
// Compiler options: -warnaserror -warn:4 -unsafe
// Test of wrong warnings
using System;
using System.ComponentModel;
public class Ev
{
object disposedEvent = new object ();
EventHandlerList Events = new EventHandlerList();
public event EventHandler Disposed
{
add { Events.AddHandler (disposedEvent, value); }
remove { Events.RemoveHandler (disposedEvent, value); }
}
public void OnClick(EventArgs e)
{
EventHandler clickEventDelegate = (EventHandler)Events[disposedEvent];
if (clickEventDelegate != null) {
clickEventDelegate(this, e);
}
}
}
public interface EventInterface {
event EventHandler Event;
}
class Foo : EventInterface {
event EventHandler EventInterface.Event
{
add { }
remove { }
}
}
public class C {
public static void my_from_fixed(out int val)
{
val = 3;
}
public static void month_from_fixed(int date)
{
int year;
my_from_fixed(out year);
}
internal static int CreateFromString (int arg)
{
int major = 0;
int number = 5;
major = number;
number = -1;
return major;
}
public unsafe double* GetValue (double value)
{
double d = value;
return &d;
}
public static void Main () {
}
}
|