2005-05-20 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Thu, 19 May 2005 21:53:58 +0000 (21:53 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 19 May 2005 21:53:58 +0000 (21:53 -0000)
* class.cs (TypeContainer.CheckRecursiveDefinition): Removed.
(TypeContainer.DefineType): Set `InTransit = true' at the
beginning of the method.

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

mcs/gmcs/ChangeLog
mcs/gmcs/class.cs

index 3537b7f1356b600d25f5792a5f58dc684ff41c38..8bea7e7b970369aece0844f9aeb293137865e31e 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-20  Martin Baulig  <martin@ximian.com>
+
+       * class.cs (TypeContainer.CheckRecursiveDefinition): Removed.
+       (TypeContainer.DefineType): Set `InTransit = true' at the
+       beginning of the method.
+
 2005-05-19  Martin Baulig  <martin@ximian.com>
 
        * delegate.cs
index 80d875b5a4a96eadc3a7c45dfaf9822a1147ff48..91befc74c4d59c95ef0a099d2e59644cc9f08920 100644 (file)
@@ -1210,6 +1210,8 @@ namespace Mono.CSharp {
 
                        TypeAttributes type_attributes = TypeAttr;
 
+                       InTransit = true;
+
                        try {
                                if (IsTopLevel){
                                        if (TypeManager.NamespaceClash (Name, Location)) {
@@ -1300,11 +1302,6 @@ namespace Mono.CSharp {
                                ptype = base_type.Type;
                        }
 
-                       if (!CheckRecursiveDefinition ()) {
-                               InTransit = false;
-                               return null;
-                       }
-
                        if (ptype != null)
                                TypeBuilder.SetParent (ptype);
 
@@ -1428,32 +1425,6 @@ namespace Mono.CSharp {
                        return true;
                }
 
-               protected bool CheckRecursiveDefinition ()
-               {
-                       if (InTransit) {
-                               Report.Error (146, Location,
-                                             "Class definition is circular: `{0}'",
-                                             GetSignatureForError ());
-                               error = true;
-                               return false;
-                       }
-
-                       InTransit = true;
-
-                       Type parent = ptype;
-                       if (parent != null) {
-                               if (parent.IsGenericInstance)
-                                       parent = parent.GetGenericTypeDefinition ();
-
-                               TypeContainer ptc = TypeManager.LookupTypeContainer (parent);
-                               if ((ptc != null) && !ptc.CheckRecursiveDefinition ())
-                                       return false;
-                       }
-
-                       InTransit = false;
-                       return true;
-               }
-
                static void Error_KeywordNotAllowed (Location loc)
                {
                        Report.Error (1530, loc, "Keyword new not allowed for namespace elements");