[mcs] Add codegen for null operator on result of awaited instance expression of prope...
[mono.git] / mcs / tests / test-189.cs
index 79fdd4158d3010f0607be764a84950a5613e243f..353c9ad41663fe893365ad62663de7a21df7eada 100644 (file)
@@ -1,16 +1,57 @@
+//
+// Test to ensure proper overload resolution with params methods
+//
+// From bugs #46199 and #43367
+// 
 using System;
 
-class X
-{
-       static int Main ()
-       {
-               while (true) {
-                       break;
+class MyTest {
 
-                       while (true)
-                               Console.WriteLine ("Test");
-               }
+        public static int Main (String[] args)
+        {
+                if (m (1, 2) != 0)
+                        return 1;
 
-               return 0;
-       }
+                MonoTest2 test = new MonoTest2 ();
+                if (test.method1 ("some message", "some string") != 0)
+                        return 1;
+
+                return 0;
+        }
+
+        public static int m(int a, double b)
+        {
+                return 1;
+        }
+
+        public static int m(int x0, params int[] xr)
+        {
+                return 0;
+        }
+}
+
+public class MonoTest
+{   
+        public virtual int method1 (string message, params object[] args)
+        {
+                return 1;
+        }
+
+        public void testmethod ()
+        {              
+                method1 ("some message", "some string");
+        }
+}
+       
+public class MonoTest2 : MonoTest {
+
+        public override int method1 (string message, params object[] args)
+        {
+                return 0;
+        }
+        
+        public void testmethod2 ()
+        {
+                method1 ("some message ", "some string");
+        }
 }