[Mono-bugs] [Bug 79081][Nor] New - mcs doesn't complain about using static methods inside a private inner class from another class.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue Aug 15 17:31:22 EDT 2006


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 alex.olk at googlemail.com.

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

--- shadow/79081	2006-08-15 17:31:22.000000000 -0400
+++ shadow/79081.tmp.3894	2006-08-15 17:31:22.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 79081
+Product: Mono: Compilers
+Version: 1.0
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: alex.olk at googlemail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs doesn't complain about using static methods inside a private inner class from another class.
+
+Take a look at the test case below.
+
+mcs compiles this code just fine, csc doesn't (as it should).
+
+It should fail because of visibility/accessibility.
+
+Btw, if I copy the exe over to windows and execute it there I get a 
+System.MethodAccessException.
+
+
+using System;
+
+namespace PrivateTest
+{
+	public sealed class A
+	{
+		private class B
+		{
+			public static void Method ()
+			{
+				Console.WriteLine("bla");
+			}
+		}
+	}
+	
+	class MainClass
+	{
+		public static void Main(string[] args)
+		{
+			A.B.Method ();
+		}
+	}
+}


More information about the mono-bugs mailing list