}
}
+public class ClassA {}
+
public class main {
public static int Main () {
Base b = new Derived ();
MethodInfo method = typeof (Base).GetMethod ("virt");
- Type [] args = { typeof (string) };
+ Type [] arg_types = { typeof (object), typeof (string), typeof (ClassA),
+ typeof (Base), typeof (Derived) };
+ Type [] array_types = { typeof (object []), typeof (string []), typeof (ClassA []),
+ typeof (Base []), typeof (Derived []) };
+
+ for (int j = 0; j < 100; ++j)
+ for (int i = 0; i < arg_types.Length; ++i)
+ {
+ Type [] args = { arg_types [i] };
+ MethodInfo inflated = method.MakeGenericMethod (args);
- method = method.MakeGenericMethod (args);
+ if (inflated.Invoke (b, null).GetType () != array_types [i])
+ return 1;
+ }
- if (method.Invoke (b, null).GetType () != typeof (string []))
- return 1;
return 0;
}
}