[Mono-bugs] [Bug 29484][Wis] New - Compiler allows protected constructors to be invoked

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
27 Aug 2002 00:49:50 -0000


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 miguel@ximian.com.

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

--- shadow/29484	Mon Aug 26 20:49:50 2002
+++ shadow/29484.tmp.13224	Mon Aug 26 20:49:50 2002
@@ -0,0 +1,38 @@
+Bug#: 29484
+Product: Mono/MCS
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: martin@gnome.org                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Compiler allows protected constructors to be invoked
+
+The following program is compiled by MCS, but it should report an
+error instead:
+
+
+class X {
+	static void Main ()
+	{
+		new Y ();
+	}
+}
+	
+
+class Y {
+	protected Y ()
+	{
+	}
+}
+
+The error expected is:
+a.cs(4,3): error CS0122: 'Y.Y()' is inaccessible due to its protection level