2002-09-11 Miguel de Icaza <miguel@ximian.com>
+ * pending.cs (PendingImplementation): pass the container pointer.
+
+ * interface.cs (GetMethods): Allow for recursive definition. Long
+ term, I would like to move every type to support recursive
+ definitions, not the current ordering mechanism that we have right
+ now.
+
+ The situation is this: Attributes are handled before interfaces,
+ so we can apply attributes to interfaces. But some attributes
+ implement interfaces, we will now handle the simple cases
+ (recursive definitions will just get an error).
+
* parameter.cs: Only invalidate types at the end if we fail to
lookup all types.
//
if (implementing.DeclaringType.IsInterface)
flags |= MethodAttributes.NewSlot;
-
+
flags |=
MethodAttributes.Virtual |
MethodAttributes.HideBySig;
IMemberContainer parent_container;
MemberCache member_cache;
+ bool members_defined;
+
// These will happen after the semantic analysis
// Hashtable defined_indexers;
return true;
}
- public MethodInfo [] GetMethods ()
+ //
+ // This might trigger a definition of the methods. This happens only
+ // with Attributes, as Attribute classes are processed before interfaces.
+ // Ideally, we should make everything just define recursively in terms
+ // of its dependencies.
+ //
+ public MethodInfo [] GetMethods (TypeContainer container)
{
- int n = method_builders.Count;
+ int n = 0;
+
+ if (!members_defined){
+ if (DefineMembers (container))
+ n = method_builders.Count;
+ } else
+ n = method_builders.Count;
+
MethodInfo [] mi = new MethodInfo [n];
method_builders.CopyTo (mi, 0);
member_cache = new MemberCache (this);
#endif
-
+ members_defined = true;
return true;
}