[Mono-bugs] [Bug 81818][Nor] New - CS0229 Ambiguity Error

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Jun 6 16:52:47 EDT 2007


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 monkey at jpobst.com.

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

--- shadow/81818	2007-06-06 16:52:47.000000000 -0400
+++ shadow/81818.tmp.4260	2007-06-06 16:52:47.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 81818
+Product: Mono: Compilers
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: monkey at jpobst.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CS0229 Ambiguity Error
+
+csc compiles the attached code and prints "This should be printed".
+
+mcs/gmcs fail on compile with:
+
+test14.cs(26,25): error CS0229: Ambiguity between `MyClass.A.MouseClick'
+and `MyClass.B.MouseClick'
+test14.cs(7,43): (Location of the symbol related to previous error)
+test14.cs(26,25): error CS0122: `MyClass.C.MouseClick()' is inaccessible
+due to its protection level
+test14.cs(17,33): (Location of the symbol related to previous error)
+
+test program:
+
+using System;
+
+public class MyClass
+{
+	public class A
+	{
+		public event EventHandler MouseClick;
+	}
+	
+	public class B : A
+	{
+		public new event EventHandler MouseClick;
+	}
+	
+	public class C : B
+	{
+		public new void MouseClick ()
+		{
+			Console.WriteLine ("This should be printed");
+		}
+	}
+	
+	static public void Main ()
+	{
+		C myclass = new C ();
+		myclass.MouseClick ();
+	}
+}


More information about the mono-bugs mailing list