[mcs] Use correct types comparer for comparing hidden imported interface members...
[mono.git] / mcs / tests / test-364.cs
1 //
2 // Test for bug: 69614
3 //
4 // Basically, this tests that we can capture parameters and use them outside the delegate
5 //
6 using System;
7
8 class X {
9
10         delegate int Foo ();
11         
12         public static int Main ()
13         {
14                 int x = t1 (1);
15                 if (x != 1)
16                         return 1;
17                 x = t2 (2);
18                 if (x != 3)
19                         return 2;
20                 return 0;
21         }
22
23         static int t1 (int p)
24         {
25                 Foo f = delegate {
26                         return p;
27                 };
28                 return f ();
29         }
30
31         static int t2 (int p)
32         {
33                 p++;
34                 Foo f = delegate {
35                         return p;
36                 };
37                 return f ();
38         }
39
40         //
41         // This is just here to check that it compiles, but the logic is the
42         // same as the ones before
43         
44         public static void Main2 (string[] argv)
45         {
46                 Console.WriteLine ("Test");
47
48                 Delegable db = new Delegable ();
49                 if (argv.Length > 1) {
50                         db.MyDelegate += delegate (object o, EventArgs args) {
51                                 Console.WriteLine ("{0}", argv);
52                                 Console.WriteLine ("{0}", db);
53                         };
54                 }
55         }       
56 }
57
58 class Delegable {
59         public event EventHandler MyDelegate;
60 }
61
62