Toggle the turbo button
[mono.git] / mcs / tests / test-237.cs
1 // Test for bug #56442
2
3 public class Params
4 {
5         public static readonly object[] test       = new object[] { 1,         "foo",         3.14         };
6         public static readonly object[] test_types = new object[] { typeof(int), typeof(string), typeof(double) };
7         
8         public delegate void FOO(string s, params object[] args);
9         
10         public static void foo(string s, params object[] args)
11         {
12                 if (args.Length != test.Length)
13                         throw new System.Exception("Length mismatch during " + s + " invocation");
14                 for (int i = 0; i < args.Length; ++i)
15                         if (args[i].GetType() != test_types[i])
16                                 throw new System.Exception("Type mismatch: " + args[i].GetType() + " vs. " + test_types[i]);
17         }
18
19         public static void Main()
20         {
21                 foo("normal", test);
22                 FOO f = new FOO(foo);
23                 f("delegate", test);
24         }
25 }