+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
TypeAttributes type_attributes = TypeAttr;
+ InTransit = true;
+
try {
if (IsTopLevel){
if (TypeManager.NamespaceClash (Name, Location)) {
ptype = base_type.Type;
}
- if (!CheckRecursiveDefinition ()) {
- InTransit = false;
- return null;
- }
-
if (ptype != null)
TypeBuilder.SetParent (ptype);
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");