Shorter
[mono.git] / mcs / tests / test-318.cs
1 // This code must be compilable without any warning
2 // Compiler options: -warnaserror -warn:4 -unsafe
3 // Test of wrong warnings
4
5 using System;
6 using System.ComponentModel;
7
8 public class Ev
9 {
10         object disposedEvent = new object ();
11         EventHandlerList Events = new EventHandlerList();
12                 
13         public event EventHandler Disposed
14         {
15                 add { Events.AddHandler (disposedEvent, value); }
16                 remove { Events.RemoveHandler (disposedEvent, value); }
17         }
18
19         public void OnClick(EventArgs e)
20         {
21             EventHandler clickEventDelegate = (EventHandler)Events[disposedEvent];
22             if (clickEventDelegate != null) {
23                 clickEventDelegate(this, e);
24             }
25         }
26 }
27
28 public interface EventInterface {
29         event EventHandler Event;
30 }
31
32 class Foo : EventInterface {
33         event EventHandler EventInterface.Event
34         {
35                         add { }
36                         remove { }
37         }
38 }
39
40 public class C {
41     
42         public static void my_from_fixed(out int val)
43         {
44                 val = 3;
45         }
46         
47         public static void month_from_fixed(int date)
48         {
49                 int year;
50                 my_from_fixed(out year);
51         }
52         
53         internal static int CreateFromString (int arg)
54         {
55                 int major = 0;
56                 int number = 5;
57
58                 major = number;
59                 number = -1;
60                     
61                 return major;
62         }   
63         
64         public unsafe double* GetValue (double value)
65         {
66                 double d = value;
67                 return &d;
68         }        
69         
70         public static void Main () {
71         }
72 }