Bugzilla – Bug 311930
Children can access Parent's private fields
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by seank@users.sf.net 2003-01-20 00:13:27 MST ---- Description of Problem: mcs allows child classes to access their parent's private fields. Steps to reproduce the problem: using System; public class Parent { Parent() { Val=10; } private int Val; } public class Child : Parent { Child() { Console.WriteLine(Val); } } Actual Results: Compilation suceeded Expected Results: error CS0122: 'Parent.Val' is inaccessible due to its protection level Additional Information: https://bugzilla.novell.com/show_bug.cgi?id=MONO35631 seems to be a side effect of this bug. ---- Additional Comments From gonzalo@ximian.com 2003-02-04 19:14:33 MST ---- *** This bug has been marked as a duplicate of https://bugzilla.novell.com/show_bug.cgi?id=MONO36732 *** Unknown operating system unknown. Setting to default OS "Other". This bug was marked DUPLICATE in the database it was moved from. Changing resolution to "MOVED"