[Mono-bugs] [Bug 55780][Wis] New - Properties should hide wrt reading and writing

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 18 Mar 2004 20:09:36 -0500 (EST)


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 bmaurer@users.sf.net.

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

--- shadow/55780	2004-03-18 20:09:36.000000000 -0500
+++ shadow/55780.tmp.32452	2004-03-18 20:09:36.000000000 -0500
@@ -0,0 +1,36 @@
+Bug#: 55780
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: bmaurer@users.sf.net               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Properties should hide wrt reading and writing
+
+We compile this:
+
+using System;
+
+class A {
+	public int Foo { get { return 1; } }
+}
+
+class B : A {
+	public new int Foo { set { } }
+	static void Main ()
+	{
+		Console.WriteLine (new B ().Foo);
+	}
+}
+
+However, we should not. In the context of Main, Foo is write only, because
+the property decl. should hide the setter in the base class.