Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mcs / tests / test-275.cs
1 using System;
2
3 public delegate int DelType ();
4
5 struct S
6 {
7         public event DelType MyEvent;
8         public static event DelType MyEventStatic;
9         
10         public int RunInstance ()
11         {
12                 return MyEvent ();
13         }
14         
15         public int RunStatic ()
16         {
17                 return MyEventStatic ();
18         }
19 }
20
21 public class Test
22 {
23         public static int Main ()
24         {
25                 S.MyEventStatic += delegate () { return 22; };
26                 S s = new S ();
27                 s.MyEvent += delegate () { return 6; };
28                 if (s.RunInstance () != 6)
29                         return 1;
30                 
31                 if (s.RunStatic () != 22)
32                         return 2;
33                 
34                 return 0;
35         }
36 }