[Mono-bugs] [Bug 75088][Nor] New - Accessing a protected member yields error CS1540 instead of CS0122

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun May 29 08:02:37 EDT 2005


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 jo at lumumba.luc.ac.be.

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

--- shadow/75088	2005-05-29 08:02:37.000000000 -0400
+++ shadow/75088.tmp.18636	2005-05-29 08:02:37.000000000 -0400
@@ -0,0 +1,41 @@
+Bug#: 75088
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: jo at lumumba.luc.ac.be               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Accessing a protected member yields error CS1540 instead of CS0122
+
+Description of Problem:
+Accessing a protected (non-static) member of class A in class B yields error CS1540, while the 
+MS C# compiler yields CS0122.
+
+Steps to reproduce the problem:
+1. Access a non-static protected member of one class in another
+2. Compile the classes
+
+Actual Results:
+B.cs(7) error CS1540: Cannot access protected member `A.x' via a qualifier of type `A'; the 
+qualifier must be of type `B' (or derived from it)
+A.cs(3): 'A.x' (name of symbol related to previous error
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+B.cs(7) error CS0122: 'A.x' is inaccessible due to its protection level
+
+How often does this happen? 
+Always
+
+Additional Information:
+This seems to be closely related to bug 28607: http://bugzilla.ximian.com/show_bug.cgi?
+id=28607


More information about the mono-bugs mailing list