[Mono-bugs] [Bug 70129][Nor] New - Private events are not really private
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Thu, 2 Dec 2004 06:35:46 -0500 (EST)
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 lluis@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=70129
--- shadow/70129 2004-12-02 06:35:46.000000000 -0500
+++ shadow/70129.tmp.3937 2004-12-02 06:35:46.000000000 -0500
@@ -0,0 +1,43 @@
+Bug#: 70129
+Product: Mono: Compilers
+Version: 1.1
+OS: SUSE 9.1
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: lluis@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Private events are not really private
+
+The following code should not compile:
+
+using System;
+
+class X
+{
+ static void Main ()
+ {
+ BB b = new BB ();
+ b.AnEvent += DoIt;
+ }
+
+ public static void DoIt (object sender, EventArgs args) {}
+}
+
+public class BB
+{
+ event EventHandler AnEvent;
+}
+
+Actual Results:
+Compiles.
+
+Expected Results:
+error CS0122: 'BB.AnEvent' is inaccessible due to its protection level.