mail-archives/mono-bugs/2003-July/006265.html

125 строки
3.8 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 46088][Nor] New - Nested class can access private members of base class of enclosing class
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:bugzilla-daemon%40rocky.ximian.com">
<META NAME="robots" CONTENT="index,nofollow">
<LINK REL="Previous" HREF="006264.html">
<LINK REL="Next" HREF="006266.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 46088][Nor] New - Nested class can access private members of base class of enclosing class
</H1>
<B>bugzilla-daemon@rocky.ximian.com
</B>
<A HREF="mailto:bugzilla-daemon%40rocky.ximian.com"
TITLE="[Mono-bugs] [Bug 46088][Nor] New - Nested class can access private members of base class of enclosing class">bugzilla-daemon@rocky.ximian.com
</A><BR>
<I>Thu, 10 Jul 2003 10:38:34 -0400 (EDT)</I>
<P><UL>
<LI> Previous message: <A HREF="006264.html">[Mono-bugs] [Bug 42850][Nor] Changed - MCS Incorrectly handles Decimal constants in multi-bound arrays
</A></li>
<LI> Next message: <A HREF="006266.html">[Mono-bugs] [Bug 42264][Min] Changed - typeof(System.Void) is not allowed
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#6265">[ date ]</a>
<a href="thread.html#6265">[ thread ]</a>
<a href="subject.html#6265">[ subject ]</a>
<a href="author.html#6265">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>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 <A HREF="mailto:sestoft@dina.kvl.dk.">sestoft@dina.kvl.dk.</A>
<A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=46088">http://bugzilla.ximian.com/show_bug.cgi?id=46088</A>
--- shadow/46088 Thu Jul 10 10:38:34 2003
+++ shadow/46088.tmp.1852 Thu Jul 10 10:38:34 2003
@@ -0,0 +1,61 @@
+Bug#: 46088
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: <A HREF="mailto:mono-bugs@ximian.com">mono-bugs@ximian.com</A>
+ReportedBy: <A HREF="mailto:sestoft@dina.kvl.dk">sestoft@dina.kvl.dk</A>
+QAContact: <A HREF="mailto:mono-bugs@ximian.com">mono-bugs@ximian.com</A>
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Nested class can access private members of base class of enclosing class
+
+Description of Problem:
+
+A nested class can access private members of base class of the enclosing
+class; it should not be permitted to.
+
+Steps to reproduce the problem:
+1. Compile this program:
+
+using System;
+
+class B {
+ private static int bz = 10;
+}
+
+class C : B {
+ public class D {
+ public static int dz = bz + 2;
+ }
+}
+
+class MyTest {
+ public static void Main(String[] args) {
+ Console.WriteLine(C.D.dz);
+ }
+}
+
+
+Actual Results:
+
+Mono mcs 0.23 compiles it without warnings or errors.
+
+Expected Results:
+
+The compiler should reject the access bz inside class C.D.
+
+
+How often does this happen?
+
+Always.
+
+Additional Information:
+
+MS csc 1.1 rejects this access.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI> Previous message: <A HREF="006264.html">[Mono-bugs] [Bug 42850][Nor] Changed - MCS Incorrectly handles Decimal constants in multi-bound arrays
</A></li>
<LI> Next message: <A HREF="006266.html">[Mono-bugs] [Bug 42264][Min] Changed - typeof(System.Void) is not allowed
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#6265">[ date ]</a>
<a href="thread.html#6265">[ thread ]</a>
<a href="subject.html#6265">[ subject ]</a>
<a href="author.html#6265">[ author ]</a>
</LI>
</UL>
</body></html>