[Mono-bugs] [Bug 29479][Min] Changed - mcs allows 'using XXX' when XXX does not exists

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
12 Sep 2002 08:14:03 -0000

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/29479	Wed Sep 11 23:02:30 2002
+++ shadow/29479.tmp.3334	Thu Sep 12 04:14:02 2002
@@ -126,6 +126,20 @@
 should, so we end up emitting a bunch of warnings.
 Currently corlib generates 490 of these warnings, i am not sure if it
 is even worth fixing, so for now am making this feature available only
 at warning level 4 (the default is 2).
+------- Additional Comments From lupus@ximian.com  2002-09-12 04:14 -------
+I assume you're doing the check on a per-file basis, right?
+You'll get very few (or none) warnings if you keep record of the
+namespaces as global to the compilation run instead of on a per-file
+basis. The location of the using statement would be only used to
+report the warning, not to check that _in that file_ the using
+statement was needed (since neither csc warns about this, right? We
+issue the warning only because it costs compile time).
+So, for example, if a random file in corlib has:
+using System.Runtime.CompilerServices;
+but it doesn't use types from that namespace in that file, no warning
+is flagged, because there are other files in the corlib build that
+reference that namespace.