[Mono-bugs] [Bug 52408][Wis] Changed - MCS does not know the difference between a `new' property and an `override' property

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 21 Dec 2003 11:17:44 -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.


--- shadow/52408	2003-12-21 02:32:29.000000000 -0500
+++ shadow/52408.tmp.31819	2003-12-21 11:17:43.000000000 -0500
@@ -1,14 +1,14 @@
 Bug#: 52408
 Product: Mono/Compilers
 Version: unspecified
+OS: unknown
 OS Details: 
 Status: NEW   
+Severity: Unknown
 Priority: Wishlist
 Component: C#
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -51,6 +51,25 @@
 Additional Information:
 I am not sure how we can tell this from the Metadata, we are not given
 much. The PropertyInfo gives no way for us to tell the new case from the
 override case. I think we have to look *directly* at the MethodInfo.
+------- Additional Comments From bmaurer@users.sf.net  2003-12-21 11:17 -------
+Note in the spec, sec 17.6.2 it states:
+`When a derived class declares a property by the same name as an
+inherited property, the derived property hides the inherited property
+with respect to both reading and writing.'
+It gives an example that we are not able to compile and use correctly:
+class A  { public int P { set {...} } } 
+class B: A  { new public int P { get {...} } }
+B b = new B();
+b.P = 1; // Error, B.P is read-only
+((A)b).P = 1;  // Ok, reference to A.P
+On the line b.P we do not report an error.