[Mono-bugs] [Bug 40833][Maj] New - Nested Namespace problem

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sun, 6 Apr 2003 08:53:38 -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 gvaish@adobe.com.

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

--- shadow/40833	Sun Apr  6 08:53:38 2003
+++ shadow/40833.tmp.19405	Sun Apr  6 08:53:38 2003
@@ -0,0 +1,56 @@
+Bug#: 40833
+Product: Mono/MCS
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Major
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gvaish@adobe.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Nested Namespace problem
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+ A class declaration
+ namesapce One { class Two { ... } }
+and a namespace declaration
+ namesapce One.Two { ... }
+
+cannot occur together. The name One::Two is already defined!
+
+
+Steps to reproduce the problem:
+1. Compile the given program (see attachment)
+
+Actual Results:
+ It compiles with mcs
+
+Expected Results:
+ It should throw error CS0101.
+
+How often does this happen? 
+ Always.
+
+Additional Information:
+ Need to look at the way we populate the hierarchy.
+ IMHO, we should not populate Namespace class directly. Infact, the 
+Namespace class should *NOT* contain any dots in the name.
+ Also, it should have the following fields:
+  Namespace Parent;
+  Namespace[] Children;
+
+ So, for the namespaces One.Two.Three and One.Two.Four, we will have tree:
+
+One:  ::Name = One, ::Parent = null, ::Children = { Two }
+Two:  ::Name = Two, ::Parent = One,  ::Children = { Three, Four }
+Three:
+      ::Name = Three, ::Parent = Two, ::Children = { null }
+Four: ::Name = Four, ::Parent = Two, ::Children = { null }