X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Ftests%2Ftest-189.cs;h=353c9ad41663fe893365ad62663de7a21df7eada;hb=890f40d7ad1d68ea5ff86ffdd3f6829dbd86b3ab;hp=79fdd4158d3010f0607be764a84950a5613e243f;hpb=64655bb5ff8963dc61d8594bd2bfe584c6efbeb3;p=mono.git diff --git a/mcs/tests/test-189.cs b/mcs/tests/test-189.cs index 79fdd4158d3..353c9ad4166 100644 --- a/mcs/tests/test-189.cs +++ b/mcs/tests/test-189.cs @@ -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"); + } }