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 [EMAIL PROTECTED]

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

--- shadow/78602        2006-06-07 10:54:16.000000000 -0400
+++ shadow/78602.tmp.31915      2006-06-07 10:54:16.000000000 -0400
@@ -0,0 +1,74 @@
+Bug#: 78602
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: [EMAIL PROTECTED]                            
+ReportedBy: [EMAIL PROTECTED]               
+QAContact: [EMAIL PROTECTED]
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Can't access protected property in base class of outer class when 
inner class inherits the same base class
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+When an inner class inherits the same base class as the outer class, 
+attempting to access a protected property in the base of an instance of 
+the outer class from within the inner class fails compilation with error 
+CS1540.
+
+Steps to reproduce the problem:
+1. Attempt to compile the following code:
+using System;
+class Base
+{
+       protected string H {
+               get {
+                       return "Base.H";
+               }
+       }
+}
+class Derived: Base
+{
+       public class Nested : Base
+       {
+               public void G() {
+                       Derived d = new Derived();
+                       Console.WriteLine(d.H);
+               }
+       }
+}
+class Test
+{
+       static void Main() {
+               Derived.Nested n = new Derived.Nested();
+               n.G();
+       }
+}
+2. 
+3. 
+
+Actual Results:
+
+MonoTest.cs(16,22): error CS1540: Cannot access protected member `Base.H' 
+via a qualifier of type `Derived'; the qualifier must be of type 
+`Derived.Nested' (or derived from it)
+Compilation failed: 1 error(s), 0 warnings
+Expected Results:
+
+Successful compilation
+
+How often does this happen? 
+
+Always
+
+Additional Information:
+
+The code compiles using the Microsoft .NET SDK compiler.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to