public Tree ()
{
- root_types = new TypeContainer (null, null, "", new Location (-1));
+ root_types = new TypeContainer ();
decls = new Hashtable ();
namespaces = new Hashtable ();
public void RecordDecl (string name, DeclSpace ds)
{
if (decls.Contains (name)){
+ DeclSpace other = (DeclSpace) decls [name];
+ Report.SymbolRelatedToPreviousError (other.Location, other.GetSignatureForError ());
+
Report.Error (
101, ds.Location,
"There is already a definition for `" + name + "'");
- DeclSpace other = (DeclSpace) decls [name];
- Report.Error (0,
- other.Location, "(Location of symbol related to previous error)");
return;
}
+ ds.RecordDecl ();
+
int p = name.LastIndexOf ('.');
if (p == -1)
decl_ns_name.Insert ("", name, ds);