[Mono-bugs] [Bug 62968][Nor] New - mcs doesn't give CS0038 for nonstatic members of base outer class.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 12 Aug 2004 15:10:01 -0400 (EDT)


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 cleonard@go.ro.

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

--- shadow/62968	2004-08-12 15:10:01.000000000 -0400
+++ shadow/62968.tmp.16079	2004-08-12 15:10:01.000000000 -0400
@@ -0,0 +1,77 @@
+Bug#: 62968
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: cleonard@go.ro               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: mcs doesn't give CS0038 for nonstatic members of base outer class.
+
+Description of Problem:
+mcs gives CS0038 if you try to access a nonstatic member of outer classes.
+Here is an example:
+
+class A
+{
+    public int X;
+    class B
+    {
+        public void Error()
+        {
+            X = 1;
+        }
+    }
+}
+
+However it doesn't give an error if X is in a base class of A.
+
+Steps to reproduce the problem:
+1. Copy/Paste the following code into Test.cs
+
+/* */
+public class A
+{
+    public int X;
+}
+
+public class B: A
+{
+    public class C
+    {
+        public void Error()
+        {
+            ++X;
+        }
+    }
+}
+
+public class Test
+{
+    public static void Main()
+    {
+        new B.C().Error();
+    }
+}
+/* */
+
+2. mcs Test.cs
+
+Actual Results:
+Compilation Succeeded
+
+Expected Results:
+Compilation Failed with CS0038
+
+How often does this happen? 
+Every Time.
+
+Additional Information: This is mcs 1.0