2002-08-19 Martin Baulig <martin@gnome.org>
[mono.git] / mcs / mcs / namespace.cs
index 215a07e6270bb32958b4afa8915b621eb0dbb9ab..d01bde48642adb163637cac88fa5a2cd58b269e2 100755 (executable)
@@ -20,7 +20,7 @@ namespace Mono.CSharp {
                string name;
                ArrayList using_clauses;
                Hashtable aliases;
-               bool decl_found = false;
+               public bool DeclarationFound = false;
                
                /// <summary>
                ///   Constructor Takes the current namespace and the
@@ -57,23 +57,13 @@ namespace Mono.CSharp {
                        }
                }
 
-               /// <summary>
-               ///   When a declaration is found in a namespace,
-               ///   we call this function, to emit an error if the
-               ///   program attempts to use a using clause afterwards
-               /// </summary>
-               public void DeclarationFound ()
-               {
-                       decl_found = true;
-               }
-
                /// <summary>
                ///   Records a new namespace for resolving name references
                /// </summary>
-               public void Using (string ns)
+               public void Using (string ns, Location loc)
                {
-                       if (decl_found){
-                               Report.Error (1529, "A using clause must precede all other namespace elements");
+                       if (DeclarationFound){
+                               Report.Error (1529, loc, "A using clause must precede all other namespace elements");
                                return;
                        }