[Mono-bugs] [Bug 47043][Nor] New - Incorrect ambiguous call error

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 29 Jul 2003 10:56:27 -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 lluis@ximian.com.

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

--- shadow/47043	Tue Jul 29 10:56:27 2003
+++ shadow/47043.tmp.27968	Tue Jul 29 10:56:27 2003
@@ -0,0 +1,80 @@
+Bug#: 47043
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lluis@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Incorrect ambiguous call error
+
+Description of Problem:
+In the following test case, mcs gives the error "Ambiguous call when
+selecting function due to implicit casts", but there is no such ambiguity
+
+Steps to reproduce the problem:
+Compile class A and B in a dll.
+Try to compile class MainClass referencing the dll.
+
+-----------------
+CLASS A AND B:
+
+public class A
+{
+	public static bool operator==(A a1, A a2)
+	{
+		return true;
+	}
+
+	public static bool operator!=(A a1, A a2)
+	{
+		return false;
+	}
+
+	public override bool Equals (object o)
+	{
+		return true;
+	}
+
+	public override int GetHashCode ()
+	{
+		return base.GetHashCode ();
+	}
+
+	public int KK () { return 1; }
+}
+
+public class B : A
+{
+}
+
+-----------------------
+CLASS MainClass:
+
+public class MainClass
+{
+	public static void Main ()
+	{
+		A a = new A ();
+		B b = new B ();
+		bool r = (a == b);
+	}
+}
+
+Actual Results:
+Internal(1) error CS0121: Ambiguous call when selecting function due to
+implicit casts
+
+Expected Results:
+Compilation succeeded.
+
+How often does this happen? 
+Allways