[Mono-bugs] [Bug 46500][Nor] Changed - CSC namespace error that MCS doesn't catch

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 23 Jul 2003 10:47: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 lupus@ximian.com.


--- shadow/46500	Tue Jul 22 18:46:54 2003
+++ shadow/46500.tmp.8224	Wed Jul 23 10:47:01 2003
@@ -71,6 +71,30 @@
 ------- Additional Comments From peter@newton.cx  2003-07-22 18:46 -------
 CSC raises the error correctly: see
 At the very least, we should reject the same code that CSC rejects so
 that code written for Mono can be compiled on Windows.
+------- Additional Comments From lupus@ximian.com  2003-07-23 10:47 -------
+Compiling the following code to a dll and using it instead of the
+reference to corlib, still exposes the csc error.
+namespace Mono.Math {
+	public class Hello {
+	}
+The issue that peter points out is that inside the methods for a class
+in the Mono.Something namespace, you can reference classes in the Mono
+namespace without specifying a using clause of the full name (note,
+this works for both the Mono and the Mono.Something namespaces).
+For example, both mcs and csc compile the following program:
+namespace System.Temp {
+	class T {
+		static void Main () {
+			int i = Math.Abs (1);
+		}
+	}
+In the test case above, csc follows the same rule, finds a class (or
+namespace) named Math in the Mono namespace, but it doesn't find
+anything for 'Abs' and errors out. I guess at this point, mcs
+continues the search instead.