[Mono-bugs] [Bug 43359][Wis] Changed - Overloaded method selection doesn't follow ECMA spec

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 21 May 2003 17:38:07 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by skeet@pobox.com.

http://bugzilla.ximian.com/show_bug.cgi?id=43359

--- shadow/43359	Wed May 21 15:33:43 2003
+++ shadow/43359.tmp.4472	Wed May 21 17:38:07 2003
@@ -107,6 +107,57 @@
 code will break when compiled with mcs).
 
 Let me assign this to myself for now although I am not sure if we
 should be fixing this. 
 
 Miguel, comments ?
+
+------- Additional Comments From skeet@pobox.com  2003-05-21 17:38 -------
+Understood. If you wish to be csc-compatible on this, there's another
+example where csc appears to be even *more* broken (in the same way)
+but mcs gets it right:
+
+using System;
+
+public class Base
+{
+    public virtual void Method (int parameter)
+    {
+        Console.WriteLine ("int");
+    }
+}
+
+public class Derived : Base
+{
+    public void Method (double parameter)
+    {
+        Console.WriteLine ("double");
+    }
+
+    public override void Method (int parameter)
+    {
+        Console.WriteLine ("int");
+    }
+    
+    public static void Main()
+    {
+        Derived d = new Derived();
+        d.Method(5);
+    }
+}
+
+Expected result:
+int
+
+Observed result with csc:
+double
+
+Observed result with mcs:
+int
+
+Goodness knows how they've managed to make it quite that broken.
+
+Could an option be put into mcs to switch between "ECMA-compatibility"
+and "csc-compatibility" modes? Is there a plan for what to do if and
+when MS fixes the bug in csc?
+
+