Bug 324493 (MONO81818) - CS0122/CS0229 Ambiguity Error
Summary: CS0122/CS0229 Ambiguity Error
Status: RESOLVED FIXED
Alias: MONO81818
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 1.2
Hardware: i386 Ubuntu
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-06 23:52 UTC by Jonathan Pobst
Modified: 2010-05-18 19:02 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:41:00 UTC


---- Reported by monkey@jpobst.com 2007-06-06 16:52:47 MST ----

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 ();
	}
}


Unknown operating system unknown. Setting to default OS "Other".

Comment 2 Marek Safar 2010-05-18 19:02:34 UTC
Fixed in trunk.