2 using System
.Reflection
;
4 public abstract class Base
{
5 public abstract object virt
<T
> ();
8 public class Derived
: Base
{
9 public override object virt
<T
> () {
14 public class ClassA
{}
17 public static int Main () {
18 Base b
= new Derived ();
20 MethodInfo method
= typeof (Base
).GetMethod ("virt");
21 Type
[] arg_types
= { typeof (object), typeof (string), typeof (ClassA
),
22 typeof (Base
), typeof (Derived
) };
23 Type
[] array_types
= { typeof (object []), typeof (string []), typeof (ClassA
[]),
24 typeof (Base
[]), typeof (Derived
[]) };
26 for (int j
= 0; j
< 100; ++j
)
27 for (int i
= 0; i
< arg_types
.Length
; ++i
)
29 Type
[] args
= { arg_types [i] }
;
30 MethodInfo inflated
= method
.MakeGenericMethod (args
);
32 if (inflated
.Invoke (b
, null).GetType () != array_types
[i
])