[Mono-bugs] [Bug 67520][Nor] Changed - MCS in cvs HEAD can't compile MD

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 7 Oct 2004 04:33:11 -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 rharinath@novell.com.

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

--- shadow/67520	2004-10-07 03:12:39.000000000 -0400
+++ shadow/67520.tmp.28800	2004-10-07 04:33:11.000000000 -0400
@@ -86,6 +86,50 @@
 is that error even generated?
 
 You are using A.B.C and csc is looking at A.B?
 
 If the main executable was in namespace A instead of A.D I would
 potentially understand, but as it stands, I don't even get csc's error.
+
+------- Additional Comments From rharinath@novell.com  2004-10-07 04:33 -------
+Todd, both the .NET 1.1 and .NET 2.0 versions of CSC complained on my
+test code.
+
+I believe the problem is in the following namespaces/classes:
+
+  //Libraries/SharpAssembly.cs
+  namespace MonoDevelop.SharpAssembly.Assembly {
+    class SharpAssembly { ... }
+  }
+
+  //Main/Base/Internal/Parser/SharpAssemblyLayer/SharpAssemblyClass.cs
+  using MonoDevelop.SharpAssembly.Assembly;
+  namespace MonoDevelop.Internal.Parser {
+    ... code using 'SharpAssembly' ... // (1)
+  }
+
+Neither namespace appears to be in the ICSharpCode namespace.  So, I
+don't know if it is from SharpDevelop or not.
+
+Also, given C# semantics of dotted namespace names, and name lookup
+rules, inside the section marked (1), 'SharpAssembly' should resolve
+to the namespace MonoDevelop.SharpAssembly, because the 'using' is
+outside of that namespace.
+
+Specifically, 
+
+  namespace A.B.C { } == namespace A { namespace B { namespace C {}}}
+
+All names in a namespace (or any other declaration space) are in the
+same bucket.  The moment you lookup a name 'X' inside namespace A.D,
+it tries A.D.X, then any 'X' introduced by 'using' clauses in A.D,
+then A.X, and so on, irrespective of whether you're looking for a
+type, or a variable, or a namespace.
+
+A possible fix is to move the 'using' into the namespace like:
+
+  //Main/Base/Internal/Parser/SharpAssemblyLayer/SharpAssemblyClass.cs
+  namespace MonoDevelop.Internal.Parser {
+    using MonoDevelop.SharpAssembly.Assembly;
+    ... code using 'SharpAssembly' ... // (1)
+  }
+