[Mono-bugs] [Bug 52408][Wis] New - 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 02:32:29 -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=52408

--- shadow/52408	2003-12-21 02:32:29.000000000 -0500
+++ shadow/52408.tmp.24340	2003-12-21 02:32:29.000000000 -0500
@@ -0,0 +1,56 @@
+Bug#: 52408
+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: MCS does not know the difference between a `new' property and an `override' property
+
+Description of Problem:
+MCS is having trouble with the scoping of properties.
+
+Steps to reproduce the problem:using System;
+
+class A {
+	public int Prop {
+		get { Console.WriteLine (this.GetType ()); return 1; }
+		set { Console.WriteLine (this.GetType ()); }
+	}
+}
+
+class B : A {
+	public int Prop {
+		get { Console.WriteLine (this.GetType ()); return 1; }
+	}
+	
+	static void Main () {
+		B b = new B ();
+		b.Prop ++;
+	}
+}
+
+Actual Results:
+Successful compile
+
+Expected Results:
+It should not compile b.Prop is readonly.
+
+How often does this happen? 
+Always
+
+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.
+
+Miguel?