[Mono-bugs] [Bug 32336][Wis] New - base.* doesn't work for properties

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
15 Oct 2002 21:47:17 -0000


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 vladimir@pobox.com.

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

--- shadow/32336	Tue Oct 15 17:47:16 2002
+++ shadow/32336.tmp.6564	Tue Oct 15 17:47:16 2002
@@ -0,0 +1,82 @@
+Bug#: 32336
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: base.* doesn't work for properties
+
+/* t16.cs */
+using System;
+
+public class FooBase {
+    int i;
+
+    public virtual int I {
+        get { return i; }
+        set {
+            Console.WriteLine ("FooBase:set_I");
+            i = value;
+        }
+    }
+
+    public virtual void Frob () {
+        Console.WriteLine ("FooBase:Frob");
+    }
+}
+
+public class Foo : FooBase {
+    public override int I {
+        get { return base.I; }
+        set {
+            Console.WriteLine ("Foo:set_I");
+            base.I = value;
+        }
+    }
+
+    public override void Frob () {
+        Console.WriteLine ("Foo:Frob");
+        base.Frob ();
+    }
+
+    public static void Main () {
+        Foo f = new Foo ();
+        f.Frob ();
+        f.I = 100;
+        Console.WriteLine (f.I);
+    }
+}
+/* end */
+
+
+Expected output:
+
+Foo:Frob
+FooBase:Frob
+Foo:set_I
+FooBase:set_I
+100
+
+Actual output (mono/mint):
+Foo:Frob
+FooBase:Frob
+Foo:set_I
+Foo:set_I
+Foo:set_I
+...
+
+note that a csc-compiled binary works correctly under mint/mono.
+
+mcs is generating virtually the same IL for the functions as csc is, so i'm
+confused as to how one works and the other doesn't -- this may be a mono
+bug, but as mono runs the csc-compiled one i'm filing it against mcs.