using System.Reflection;
using System.Reflection.Emit;
-namespace Mono.CSharp {
+namespace Mono.MonoBASIC {
/// <summary>
/// Interfaces
IMemberContainer parent_container;
MemberCache member_cache;
+ bool members_defined;
+
// These will happen after the semantic analysis
// Hashtable defined_indexers;
public Interface (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
: base (parent, name, l)
{
- ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PRIVATE, l);
+ ModFlags = Modifiers.Check (AllowedModifiers, mod, Modifiers.PUBLIC, l);
OptAttributes = attrs;
method_builders = new ArrayList ();
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);
if (return_type.IsPointer && !UnsafeOK (this))
return;
+ if (arg_types == null)
+ return;
+
foreach (Type t in arg_types){
if (t == null)
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 +
if (!Parent.AsAccessible (t, ModFlags))
Report.Error (61, Location,
"Inconsistent accessibility: base interface `" +
- TypeManager.CSharpName (t) + "' is less " +
+ TypeManager.MonoBASIC_Name (t) + "' is less " +
"accessible than interface `" +
Name + "'");
member_cache = new MemberCache (this);
#endif
-
+ members_defined = true;
return true;
}