A type parameter can never be optional.
[mono.git] / mcs / gmcs / tree.cs
index 21c2134a1309fca42eb32050d874bb1f9ca392df..0267f451d94ab24e91fff3a28be510f8f824d250 100755 (executable)
@@ -45,7 +45,7 @@ namespace Mono.CSharp
                
                public Tree ()
                {
-                       root_types = new TypeContainer (null, null, "", new Location (-1));
+                       root_types = new TypeContainer ();
 
                        decls = new Hashtable ();
                        namespaces = new Hashtable ();
@@ -56,15 +56,17 @@ namespace Mono.CSharp
                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);