2005-07-13 Maverson Eduardo Schulze Rosa <maverson@gmail.com>
[mono.git] / mcs / mbas / pending.cs
index 22b4dbb602541dee0e0c4576cc6f5cc99f0d8595..111b8d151f42d56df8e4b82d5813bdd72a9e3f69 100644 (file)
@@ -3,6 +3,7 @@
 //
 // Author:
 //   Miguel de Icaza (miguel@gnu.org)
+//   Anirban Bhattacharjee (banirban@novell.com)
 //
 // Licensed under the terms of the GNU GPL
 //
@@ -33,7 +34,7 @@ namespace Mono.MonoBASIC {
 
                // If a method is defined here, then we always need to
                // create a proxy for it.  This is used when implementing
-               // an interface's indexer with a different IndexerName.
+               // an interface's indexer with a different DefaultPropName.
                public MethodInfo [] need_proxy;
        }
 
@@ -133,15 +134,14 @@ namespace Mono.MonoBASIC {
                        if (ifaces != null){
                                foreach (Type t in ifaces){
                                        MethodInfo [] mi;
-
-                                       if (t is TypeBuilder){
+                                       /*if (t is TypeBuilder){
                                                Interface iface;
 
                                                iface = TypeManager.LookupInterface (t);
                                                
                                                mi = iface.GetMethods (container);
-                                       } else
-                                               mi = t.GetMethods ();
+                                       } else*/
+                                       mi = t.GetMethods ();
 
                                        int count = mi.Length;
                                        pending_implementations [i].type = t;
@@ -169,12 +169,12 @@ namespace Mono.MonoBASIC {
                                abstract_methods.CopyTo (pending_implementations [i].methods, 0);
                                pending_implementations [i].found = new bool [count];
                                pending_implementations [i].args = new Type [count][];
-                               pending_implementations [i].type = type_builder;
+                               pending_implementations [i].type = type_builder.BaseType;
                                
                                int j = 0;
                                foreach (MemberInfo m in abstract_methods){
                                        MethodInfo mi = (MethodInfo) m;
-                                       
+
                                        Type [] types = TypeManager.GetArgumentTypes (mi);
                                        
                                        pending_implementations [i].args [j] = types;
@@ -222,9 +222,10 @@ namespace Mono.MonoBASIC {
                                }
                        }
 #endif
-                                       
-                       icount = ifaces.Length;
 
+                       
+                       ifaces = TypeManager.ExpandInterfaces (ifaces);
+                       icount = ifaces.Length;
                        //
                        // If we are implementing an abstract class, and we are not
                        // ourselves abstract, and there are abstract methods (C# allows
@@ -261,12 +262,12 @@ namespace Mono.MonoBASIC {
                /// <summary>
                ///   Whether the specified method is an interface method implementation
                /// </summary>
-               public MethodInfo IsInterfaceMethod (Type t, string name, Type ret_type, Type [] args)
+               public MethodInfo IsAbstractMethod (Type t, string name, Type ret_type, Type [] args)
                {
                        return InterfaceMethod (t, name, ret_type, args, Operation.Lookup, null);
                }
 
-               public MethodInfo IsInterfaceIndexer (Type t, Type ret_type, Type [] args)
+               public MethodInfo IsAbstractIndexer (Type t, Type ret_type, Type [] args)
                {
                        return InterfaceMethod (t, null, ret_type, args, Operation.Lookup, null);
                }
@@ -296,7 +297,7 @@ namespace Mono.MonoBASIC {
                ///   all the methods with the given signature.
                ///
                ///   The `MethodInfo need_proxy' is used when we're implementing an interface's
-               ///   indexer in a class.  If the new indexer's IndexerName does not match the one
+               ///   indexer in a class.  If the new indexer's DefaultPropName does not match the one
                ///   that was used in the interface, then we always need to create a proxy for it.
                ///
                /// </remarks>
@@ -365,8 +366,8 @@ namespace Mono.MonoBASIC {
                                                // implementation and we can always clear the method.
                                                // `need_proxy' is not null if we're implementing an
                                                // interface indexer.  In this case, we need to create
-                                               // a proxy if the implementation's IndexerName doesn't
-                                               // match the IndexerName in the interface.
+                                               // a proxy if the implementation's DefaultPropName doesn't
+                                               // match the DefaultPropName in the interface.
                                                if ((t == null) && (need_proxy != null) && (name != m.Name))
                                                        tm.need_proxy [i] = need_proxy;
                                                else