Bug 311930 (MONO36951) - Children can access Parent's private fields
Summary: Children can access Parent's private fields
Status: RESOLVED MOVED
Alias: MONO36951
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-01-20 07:13 UTC by seank
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:05:52 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"