[Mono-bugs] [Bug 65410][Wis] New - Nested classes cause Namespace search problems

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 6 Sep 2004 20:42:53 -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 david.mitchell@telogis.com.

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

--- shadow/65410	2004-09-06 20:42:53.000000000 -0400
+++ shadow/65410.tmp.15128	2004-09-06 20:42:53.000000000 -0400
@@ -0,0 +1,56 @@
+Bug#: 65410
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: Gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: david.mitchell@telogis.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Nested classes cause Namespace search problems
+
+Description of Problem:
+The following code compiles with csc fine:
+
+namespace NSpace {
+    public class Child {
+        public int size;
+    }
+}
+
+namespace NSpace.ChildNS {
+    internal class Parent {
+        class Middle {
+            class Child {
+                Child other;
+
+                public void Foo() {
+                    other.other = null;
+                }
+            }
+        }
+    }
+
+    public class Tester {
+        public static void Main(string[] args) {
+            int i = 0;
+        }
+    }
+}
+
+but not on mono - giving a CS0117 'does not contain a definition for
+'other'' error.
+
+Try removing the 'Middle' class, but move the definition of the Child class
+intact so it becomes NSpace.ChildNS.Parent.Child. Compiling this works fine
+with mcs.
+
+How often does this happen? 
+Always