2 using System.Reflection;
6 public struct SimpleStruct {
11 static void Test2 () {
12 Console.WriteLine ("Test2 called");
15 public static SimpleStruct Test1 (SimpleStruct ss) {
16 Console.WriteLine ("Test1 called " + ss.a + " " + ss.b);
17 SimpleStruct res = new SimpleStruct ();
23 public static void Foo(ref int x, ref int y)
30 Type t = typeof (Test);
32 MethodInfo m2 = t.GetMethod ("Test2");
36 MethodInfo m1 = t.GetMethod ("Test1");
40 object [] args = new object [1];
41 SimpleStruct ss = new SimpleStruct ();
46 SimpleStruct res = (SimpleStruct)m1.Invoke (null, args);
53 // Test that the objects for byref valuetype arguments are
54 // automatically created
55 MethodInfo m3 = typeof(Test).GetMethod("Foo");
59 m3.Invoke(null, args);
61 if ((((int)(args [0])) != 20) || (((int)(args [1])) != 30))