[xBuild] Support use of properties defined in Choose elements in project references
[mono.git] / mono / tests / generic-virtual-invoke.2.cs
index a2c362eb5fc06504a8aa8abf6a7a3a55cae9d69b..909d4741dd1fabcc8e04300fe5beb615bb70057a 100644 (file)
@@ -11,17 +11,28 @@ public class Derived : Base {
        }
 }
 
+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;
        }
 }