[sdks] Fix README.md
[mono-project.git] / mcs / tests / test-237.cs
blob44efda93c692173700ba36b463643f71fdba76a1
1 // Test for bug #56442
3 public class Params
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) };
8 public delegate void FOO(string s, params object[] args);
10 public static void foo(string s, params object[] args)
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]);
19 public static void Main()
21 foo("normal", test);
22 FOO f = new FOO(foo);
23 f("delegate", test);