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);
PropertyBuilder pb;
MethodBuilder get = null, set = null;
ip.Type = this.ResolveTypeExpr (ip.Type, false, ip.Location);
+ if (ip.Type == null)
+ return;
+
Type prop_type = ip.Type.Type;
Type [] setter_args = new Type [1];
MyEventBuilder eb;
MethodBuilder add = null, remove = null;
ie.Type = this.ResolveTypeExpr (ie.Type, false, ie.Location);
+ if (ie.Type == null)
+ return;
+
Type event_type = ie.Type.Type;
if (event_type == null)
Type [] parameters = new Type [1];
parameters [0] = event_type;
- eb = new MyEventBuilder (TypeBuilder, ie.Name,
+ eb = new MyEventBuilder (null, TypeBuilder, ie.Name,
EventAttributes.None, event_type);
//
{
PropertyBuilder pb;
ii.Type = this.ResolveTypeExpr (ii.Type, false, ii.Location);
+ if (ii.Type == null)
+ return;
+
Type prop_type = ii.Type.Type;
Type [] arg_types = ii.ParameterTypes (this);
Type [] value_arg_types;
Type GetInterfaceTypeByName (string name)
{
- Type t = FindType (name);
+ Type t = FindType (Location, name);
if (t == null) {
Report.Error (246, Location, "The type or namespace `" + name +
member_cache = new MemberCache (this);
#endif
-
+ members_defined = true;
return true;
}