+2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * namespace.cs: avoid duplicated 'using xxx' being added to
+ using_clauses. This prevents mcs from issuing and 'ambiguous type' error
+ when we get more than one 'using' statement for the same namespace.
+ Report a CS0105 warning for it.
+
2002-11-30 Miguel de Icaza <miguel@ximian.com>
* cs-tokenizer.cs (consume_identifier): use read directly, instead
Namespace parent;
string name;
ArrayList using_clauses;
+ Hashtable using_namespaces;
Hashtable aliases;
public bool DeclarationFound = false;
if (using_clauses == null)
using_clauses = new ArrayList ();
+ if (using_namespaces == null)
+ using_namespaces = new Hashtable ();
+
+ if (using_namespaces.ContainsKey (ns)) {
+ Report.Warning (105, loc, "The using directive for '" + ns +
+ "' appeared previously in this namespace");
+ return;
+ }
+
UsingEntry ue = new UsingEntry (ns, loc);
using_clauses.Add (ue);
+ using_namespaces.Add (ns, ns);
}
public ArrayList UsingTable {