2002-03-06 Miguel de Icaza <miguel@ximian.com>
+ * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
+
* cs-parser.jay: Add opt_semicolon to the interface declaration.
* expression.cs: Pass location information to
// From any interface type S to any interface T provided S is not derived from T
//
if (source_type.IsInterface && target_type.IsInterface){
-
- Type [] ifaces = source_type.GetInterfaces ();
-
if (TypeManager.ImplementsInterface (source_type, target_type))
return null;
else
method_arguments = new PtrHashtable ();
method_internal_params = new PtrHashtable ();
builder_to_container = new PtrHashtable ();
- type_interface_cache = new PtrHashtable ();
NoTypes = new Type [0];
}
return pi.GetGetMethod ();
}
- // <remarks>
- // The following is used to check if a given type implements an interface.
- // The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
- // </remarks>
-
- static Hashtable type_interface_cache;
+ /// <remarks>
+ /// The following is used to check if a given type implements an interface.
+ /// The cache helps us reduce the expense of hitting Type.GetInterfaces everytime.
+ /// </remarks>
public static bool ImplementsInterface (Type t, Type iface)
{
Type [] interfaces;
+ //
+ // FIXME OPTIMIZATION:
+ // as soon as we hit a non-TypeBuiler in the interface
+ // chain, we could return, as the `Type.GetInterfaces'
+ // will return all the interfaces implement by the type
+ // or its parents.
+ //
do {
interfaces = t.GetInterfaces ();