2002-09-11 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 12 Sep 2002 03:10:18 +0000 (03:10 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 12 Sep 2002 03:10:18 +0000 (03:10 -0000)
* driver.cs: Activate the using-error detector at warning level
4 (at least for MS-compatible APIs).

* namespace.cs (VerifyUsing): Small buglett fix.

svn path=/trunk/mcs/; revision=7377

mcs/mcs/ChangeLog
mcs/mcs/driver.cs
mcs/mcs/namespace.cs

index 049f6afa87e704f1f1a6d9fe29251a150b2d55bd..d23f7c08cfa8293a0bb22041f7a2fb03b47bbae5 100755 (executable)
@@ -1,5 +1,10 @@
 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
 
+       * driver.cs: Activate the using-error detector at warning level
+       4 (at least for MS-compatible APIs).
+
+       * namespace.cs (VerifyUsing): Small buglett fix.
+
        * pending.cs (PendingImplementation): pass the container pointer. 
 
        * interface.cs (GetMethods): Allow for recursive definition.  Long
index 6804a41f3453cf845019d0619e12df231c058d43..cfedb0d96f2d45e9a5516425f7f9668d9213970b 100755 (executable)
@@ -1247,13 +1247,9 @@ namespace Mono.CSharp
                        if (timestamps)
                                ShowTime ("Closing types");
 
-#if WORKS
-                       //
-                       // Currently this can not be commited unles 30020 is fixed
-                       //
-                       if (!Namespace.VerifyUsing ())
-                               return false;
-#endif
+                       if (RootContext.WarningLevel >= 4)
+                               if (!Namespace.VerifyUsing ())
+                                       return false;
                        
                        RootContext.CloseTypes ();
 
index 14b400a28bc118840ce49775c0e41f95dda565ac..a173b903620bcb73b4f6b50eb6553262899e17ed 100755 (executable)
@@ -142,7 +142,11 @@ namespace Mono.CSharp {
                        int errors = 0;
                        
                        foreach (Namespace ns in all_namespaces){
-                               foreach (UsingEntry ue in ns.UsingTable){
+                               ArrayList uses = ns.UsingTable;
+                               if (uses == null)
+                                       continue;
+                               
+                               foreach (UsingEntry ue in uses){
                                        if (ue.Used)
                                                continue;
                                        unused.Add (ue);
@@ -158,13 +162,13 @@ namespace Mono.CSharp {
 
                                foreach (UsingEntry ue in unused){
                                        if (namespaces.Contains (ue.Name)){
-                                               Report.Warning (-24, ue.Location, "Unused namespace in `using' declaration");
+                                               Report.Warning (6024, ue.Location, "Unused namespace in `using' declaration");
                                                continue;
                                        }
 
                                        errors++;
-                                       Report.Error (246, ue.Location, "The namespace " + ue.Name +
-                                                     " can not be found (missing assembly reference?)");
+                                       Report.Error (246, ue.Location, "The namespace `" + ue.Name +
+                                                     "' can not be found (missing assembly reference?)");
                                }
                        }