[Mono-bugs] [Bug 31889][Min] New - mcs incorrectly allows accessing a protected property

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
7 Oct 2002 18:24:56 -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 gonzalo@ximian.com.

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

--- shadow/31889	Mon Oct  7 14:24:56 2002
+++ shadow/31889.tmp.20152	Mon Oct  7 14:24:56 2002
@@ -0,0 +1,51 @@
+Bug#: 31889
+Product: Mono/MCS
+Version: unspecified
+OS: AIX
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gonzalo@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs incorrectly allows accessing a protected property
+
+Steps to reproduce the problem:
+1. Try compiling:
+
+using System;
+
+namespace A
+{
+        class B
+        {
+                protected virtual int I { get { return 1; } }
+        }
+
+        class C : B
+        {
+                protected override int I { get { return 2; } }
+        }
+
+        class D
+        {
+                static void Main ()
+                {
+                        C c = new C ();
+                        Console.WriteLine (c.I);
+                }
+        }
+}
+
+Actual Results:
+Compilation succeeded.
+
+Expected Results:
+bugdata.cs(20,23): error CS0122: 'A.B.I' is inaccessible due to its
+protection level