[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:50:31 -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 11:17:43.000000000 -0500
+++ shadow/52408.tmp.31943	2003-12-21 11:50:31.000000000 -0500
@@ -70,6 +70,33 @@
 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.
 
+
+------- Additional Comments From bmaurer@users.sf.net  2003-12-21 11:50 -------
+Ok, I think I found the critical piece:
+
+class A {
+	public virtual int Prop {
+		get { ... }
+		
+	}
+}
+
+class B : A {
+	public override int Prop {
+		get { ... }
+		set { ... }
+	}
+}
+
+is not valid. Eg, you can not `augment' existing properties. So, what
+we need to do when we are scanning is:
+
+1) Take a look at the PropertyInfo, it will have either a get or a set
+method (or both). If neither of them are `override', then we have
+found the full set of properties
+
+2) If one of them *is* override, we need to search the base classes
+for a definition.