[Mono-bugs] [Bug 57303][Nor] New - property override breakage in internal class

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 20 Apr 2004 21:14:39 -0400 (EDT)


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=57303

--- shadow/57303	2004-04-20 21:14:39.000000000 -0400
+++ shadow/57303.tmp.21557	2004-04-20 21:14:39.000000000 -0400
@@ -0,0 +1,55 @@
+Bug#: 57303
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: property override breakage in internal class
+
+(I have no idea what the correct summary for this should be -- someone who
+understands what's going on, please change the summary)
+
+The following code:
+
+--- bug30.cs ---
+using System;
+
+public class Foo {
+  protected virtual int SomeProperty {
+    get { return 10; }
+  }
+
+  private class FooPrivate : Foo {
+    Foo _realFoo;
+
+    internal FooPrivate(Foo f) {
+      _realFoo = f;
+    }
+
+    protected override int SomeProperty {
+      get { return this._realFoo.SomeProperty; }
+    }
+  }
+
+  public static void Main () { }
+}
+
+--- end ---
+
+Fails to compile under mcs (cvs as of 4/19) with:
+
+bug30.cs(16) error CS1540: Cannot access protected member
+`Foo.SomeProperty' via a qualifier of type `Foo'; the qualifier must be of
+type `Foo+FooPrivate' (or derived from it)
+
+csc compiles this fine.  This construct shows up quite a bit in nGallery.