using System.Runtime.CompilerServices;
using System.Diagnostics;
-namespace Mono.CSharp {
+namespace Mono.MonoBASIC {
public class TypeManager {
//
static public Type char_ptr_type;
static public Type short_type;
static public Type decimal_type;
+ static public Type date_type;
static public Type bool_type;
static public Type sbyte_type;
static public Type byte_type;
static public Expression system_int32_expr, system_uint32_expr;
static public Expression system_int64_expr, system_uint64_expr;
static public Expression system_char_expr, system_void_expr;
+ static public Expression system_date_expr;
static public Expression system_asynccallback_expr;
static public Expression system_iasyncresult_expr;
//
static public ConstructorInfo cons_param_array_attribute;
static public ConstructorInfo void_decimal_ctor_five_args;
+ static public ConstructorInfo void_datetime_ctor_ticks_arg;
static public ConstructorInfo unverifiable_code_ctor;
+ static public ConstructorInfo default_member_ctor;
// <remarks>
// Holds the Array of Assemblies that have been loaded
// Keeps a list of module builders. We used this to do lookups
// on the modulebuilder using GetType -- needed for arrays
// </remarks>
- static ModuleBuilder [] modules;
+
+ // This is changed from list of ModuleBuilders
+ // to list of Modules for getting addmodule
+ // compiler option working
+ // Anirban - 13.07.2004
+
+ static System.Reflection.Module [] modules;
// <remarks>
// This is the type_cache from the assemblies to avoid
static Hashtable indexer_arguments;
// <remarks>
- // Maybe `method_arguments' should be replaced and only
+ // Maybe 'method_arguments' should be replaced and only
// method_internal_params should be kept?
// <remarks>
static Hashtable method_internal_params;
- // <remarks>
- // Keeps track of attribute types
- // </remarks>
-
- static Hashtable builder_to_attr;
-
// <remarks>
// Keeps track of methods
// </remarks>
system_uint64_expr = new TypeLookupExpression ("System.UInt64");
system_char_expr = new TypeLookupExpression ("System.Char");
system_void_expr = new TypeLookupExpression ("System.Void");
+ system_date_expr = new TypeLookupExpression ("System.DateTime");
system_asynccallback_expr = new TypeLookupExpression ("System.AsyncCallback");
system_iasyncresult_expr = new TypeLookupExpression ("System.IAsyncResult");
}
user_types = new ArrayList ();
types = new CaseInsensitiveHashtable ();
+ negative_hits = new CaseInsensitiveHashtable ();
typecontainers = new CaseInsensitiveHashtable ();
builder_to_declspace = new PtrHashtable ();
- builder_to_attr = new PtrHashtable ();
builder_to_method = new PtrHashtable ();
method_arguments = new PtrHashtable ();
method_internal_params = new PtrHashtable ();
//
// This probably never happens, as we catch this before
//
- Report.Error (-17, "The type `" + name + "' has already been defined.");
+ Report.Error (-17, "The type '" + name + "' has already been defined.");
return;
}
tc = builder_to_declspace [t] as TypeContainer;
Report.Warning (
- 1595, "The type `" + name + "' is defined in an existing assembly;"+
+ 1595, "The type '" + name + "' is defined in an existing assembly;"+
" Using the new definition from: " + tc.Location);
Report.Warning (1595, "Previously defined in: " + prev.Assembly.FullName);
builder_to_method.Add (builder, method);
}
- public static void RegisterAttrType (Type t, TypeContainer tc)
- {
- builder_to_attr.Add (t, tc);
- }
-
/// <summary>
- /// Returns the TypeContainer whose Type is `t' or null if there is no
- /// TypeContainer for `t' (ie, the Type comes from a library)
+ /// Returns the TypeContainer whose Type is 't' or null if there is no
+ /// TypeContainer for 't' (ie, the Type comes from a library)
/// </summary>
public static TypeContainer LookupTypeContainer (Type t)
{
{
return builder_to_declspace [t] as Enum;
}
-
- public static TypeContainer LookupAttr (Type t)
+
+ public static TypeContainer LookupClass (Type t)
{
- return (TypeContainer) builder_to_attr [t];
+ return builder_to_declspace [t] as TypeContainer;
}
/// <summary>
n [top] = a;
assemblies = n;
+
+ foreach(Type type in a.GetTypes()) {
+ if (type.IsPublic ) // && type. attributed as standard module
+ AddStandardModule(type);
+ }
}
/// <summary>
/// Registers a module builder to lookup types from
/// </summary>
- public static void AddModule (ModuleBuilder mb)
+ public static void AddModule (System.Reflection.Module mb)
{
int top = modules != null ? modules.Length : 0;
- ModuleBuilder [] n = new ModuleBuilder [top + 1];
+ System.Reflection.Module [] n = new System.Reflection.Module [top + 1];
if (modules != null)
modules.CopyTo (n, 0);
modules = n;
}
+ private class StandardModule {
+ public readonly string Namespace;
+ public readonly string Name;
+ private readonly string asString;
+ public StandardModule(string _namespace, string name) {
+ Namespace = _namespace;
+ Name = name;
+ asString = ((Namespace != null && Namespace.Length > 0)?(Namespace + "."):"") + Name;
+ }
+ public override string ToString() { return asString; }
+ }
+
+ private static StandardModule[] standardModules;
+
+ /// <summary>
+ /// Registers a new 'standard module' to lookup short-qualified or unqualified members
+ /// </summary>
+ internal static void AddStandardModule(Module module)
+ {
+ int top = standardModules != null ? standardModules.Length : 0;
+ StandardModule [] n = new StandardModule [top + 1];
+
+ if (standardModules != null)
+ standardModules.CopyTo (n, 0);
+ string name = module.Name;
+ int split = name.LastIndexOf('.');
+ if (split > 0)
+ name = name.Substring(split+1);
+ n [top] = new StandardModule(module.Namespace.Name, name);
+ // Console.WriteLine("Standard Module added: " + n [top]);
+ standardModules = n;
+ }
+
+ ///
+ /// Registers a existing 'standard module' to lookup short-qualified or unqualified members
+ ///
+ private static void AddStandardModule(Type type)
+ {
+ object[] attributes = type.GetCustomAttributes(false);
+ for (int i = 0; i < attributes.Length; i ++) {
+ if (attributes[i].ToString() == "Microsoft.VisualBasic.CompilerServices.StandardModuleAttribute") {
+ int top = standardModules != null ? standardModules.Length : 0;
+ StandardModule [] n = new StandardModule [top + 1];
+
+ if (standardModules != null)
+ standardModules.CopyTo (n, 0);
+ n [top] = new StandardModule(type.Namespace, type.Name) ;
+ standardModules = n;
+ return;
+ }
+ }
+ }
+
+ //
+ //
+ //
+ public static Type[] GetPertinentStandardModules(params string[] namespaces)
+ {
+ ArrayList list = new ArrayList();
+ foreach(string Namespace in namespaces)
+ {
+ for(int i = 0; i < standardModules.Length; i++) {
+ if (standardModules[i].Namespace == Namespace) {
+ string name = standardModules[i].ToString();
+ Type t = LookupType(name);
+ if (t == null) {
+ System.Console.WriteLine("Could not find standard module '" + name + "'");
+ }
+ else {
+ list.Add(t);
+ }
+ }
+ }
+ }
+ return (Type[])list.ToArray(typeof(Type));
+ }
+
//
// Low-level lookup, cache-less
//
{
Type t;
- foreach (Assembly a in assemblies){
- t = a.GetType (name);
- if (t != null)
- return t;
- }
+ try {
+ foreach (Assembly a in assemblies){
+ t = a.GetType (name, false, true);
+ if (t != null)
+ return t;
+ }
- foreach (ModuleBuilder mb in modules) {
- t = mb.GetType (name);
- if (t != null){
- return t;
+ foreach (System.Reflection.Module mb in modules) {
+ t = mb.GetType (name, false, true);
+ if (t != null){
+ return t;
+ }
}
+ } catch (Exception e) {
+ System.Console.WriteLine("\nERROR: " + e.ToString() + "WHILE EXECUTING LookupTypeReflection(\"" + name + "\")\n");
}
return null;
}
+ static CaseInsensitiveHashtable negative_hits;
//
// This function is used when you want to avoid the lookups, and want to go
// directly to the source. This will use the cache.
if (t != null)
return t;
+ if (negative_hits.Contains (name))
+ return null;
t = LookupTypeReflection (name);
if (t == null)
- return null;
-
- types [name] = t;
+ negative_hits [name] = null;
+ else
+ types [name] = t;
return t;
}
if (t != null)
return t;
+ if (negative_hits.Contains (name))
+ return null;
+
//
// Optimization: ComposedCast will work with an existing type, and might already have the
// full name of the type, so the full system lookup can probably be avoided.
for (int n = 1; n <= count; n++){
string top_level_type = String.Join (".", elements, 0, n);
+ if (negative_hits.Contains (top_level_type))
+ continue;
+
t = (Type) types [top_level_type];
if (t == null){
t = LookupTypeReflection (top_level_type);
- if (t == null)
+ if (t == null){
+ negative_hits [top_level_type] = null;
continue;
+ }
}
if (count == n){
}
string newt = top_level_type + "+" + String.Join ("+", elements, n, count - n);
- t = LookupTypeDirect (newt);
- if (t != null)
- types [newt] = t;
+ t = LookupTypeReflection (newt);
+ if (t == null)
+ negative_hits [name] = null;
+ else
+ types [name] = t;
return t;
}
+ negative_hits [name] = null;
return null;
}
{
CaseInsensitiveHashtable namespaces = new CaseInsensitiveHashtable ();
- foreach (Assembly a in assemblies){
- foreach (Type t in a.GetTypes ()){
+ foreach (Assembly a in assemblies) {
+ foreach (Type t in a.GetTypes ()) {
string ns = t.Namespace;
if (namespaces.Contains (ns))
}
}
- foreach (ModuleBuilder mb in modules){
- foreach (Type t in mb.GetTypes ()){
+ foreach (System.Reflection.Module mb in modules) {
+ foreach (Type t in mb.GetTypes ()) {
string ns = t.Namespace;
if (namespaces.Contains (ns))
namespaces [ns] = ns;
}
}
+
return namespaces;
}
/// <summary>
/// Returns the C# name of a type if possible, or the full type name otherwise
/// </summary>
- static public string CSharpName (Type t)
+ static public string MonoBASIC_Name (Type t)
{
return Regex.Replace (t.FullName,
@"^System\." +
- @"(Int32|UInt32|Int16|Uint16|Int64|UInt64|" +
- @"Single|Double|Char|Decimal|Byte|SByte|Object|" +
- @"Boolean|String|Void)" +
+ @"(Int32|Int16|Int64|Single|Double|Char|Decimal|Byte|Object|Boolean|String|DateTime)" +
@"(\W+|\b)",
- new MatchEvaluator (CSharpNameMatch));
+ new MatchEvaluator (MonoBASIC_NameMatch));
}
- static String CSharpNameMatch (Match match)
+ static String MonoBASIC_NameMatch (Match match)
{
string s = match.Groups [1].Captures [0].Value;
return s.ToLower ().
- Replace ("int32", "int").
- Replace ("uint32", "uint").
+ Replace ("int32", "integer").
Replace ("int16", "short").
- Replace ("uint16", "ushort").
Replace ("int64", "long").
- Replace ("uint64", "ulong").
- Replace ("single", "float").
- Replace ("boolean", "bool")
+ Replace ("datetime", "date")
+ match.Groups [2].Captures [0].Value;
}
/// <summary>
/// Returns the signature of the method
/// </summary>
- static public string CSharpSignature (MethodBase mb)
+ static public string MonoBASIC_Signature (MethodBase mb)
{
string sig = "(";
Type t = LookupType (name);
if (t == null){
- Report.Error (518, "The predefined type `" + name + "' is not defined or imported");
+ Report.Error (518, "The predefined type '" + name + "' is not defined or imported");
Environment.Exit (0);
}
}
/// <summary>
- /// Returns the MethodInfo for a method named `name' defined
- /// in type `t' which takes arguments of types `args'
+ /// Returns the MethodInfo for a method named 'name' defined
+ /// in type 't' which takes arguments of types 'args'
/// </summary>
static MethodInfo GetMethod (Type t, string name, Type [] args)
{
sig.name = name;
sig.args = args;
- list = FindMembers (t, MemberTypes.Method, instance_and_static | BindingFlags.Public,
+ list = FindMembers (t, MemberTypes.Method, instance_and_static | BindingFlags.Public| BindingFlags.IgnoreCase,
signature_filter, sig);
if (list.Count == 0) {
- Report.Error (-19, "Can not find the core function `" + name + "'");
+ Report.Error (-19, "Can not find the core function '" + name + "'");
return null;
}
MethodInfo mi = list [0] as MethodInfo;
if (mi == null) {
- Report.Error (-19, "Can not find the core function `" + name + "'");
+ Report.Error (-19, "Can not find the core function '" + name + "'");
return null;
}
sig.args = args;
list = FindMembers (t, MemberTypes.Constructor,
- instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly,
+ instance_and_static | BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
signature_filter, sig);
if (list.Count == 0){
- Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
+ Report.Error (-19, "Can not find the core constructor for type '" + t.Name + "'");
return null;
}
ConstructorInfo ci = list [0] as ConstructorInfo;
if (ci == null){
- Report.Error (-19, "Can not find the core constructor for type `" + t.Name + "'");
+ Report.Error (-19, "Can not find the core constructor for type '" + t.Name + "'");
return null;
}
array_type = CoreLookupType ("System.Array");
void_type = CoreLookupType ("System.Void");
+ date_type = CoreLookupType ("System.DateTime");
type_type = CoreLookupType ("System.Type");
runtime_field_handle_type = CoreLookupType ("System.RuntimeFieldHandle");
void_decimal_ctor_five_args = GetConstructor (
decimal_type, dec_arg);
+ // DateTime constructor
+ Type [] ticks_arg = { int64_type };
+ void_datetime_ctor_ticks_arg = GetConstructor ( date_type, ticks_arg);
+
//
// Attributes
//
unverifiable_code_ctor = GetConstructor (
unverifiable_code_type, void_arg);
+ default_member_ctor = GetConstructor (
+ default_member_type, string_);
}
const BindingFlags instance_and_static = BindingFlags.Static | BindingFlags.Instance;
MemberFilter filter, object criteria)
{
DeclSpace decl = (DeclSpace) builder_to_declspace [t];
-bf |= BindingFlags.IgnoreCase;
+ bf |= BindingFlags.IgnoreCase;
//
- // `builder_to_declspace' contains all dynamic types.
+ // 'builder_to_declspace' contains all dynamic types.
//
if (decl != null) {
MemberList list;
//
if ((bf & instance_and_static) == instance_and_static){
MemberInfo [] i_members = t.FindMembers (
- mt, bf & ~BindingFlags.Static, filter, criteria);
+ mt, (bf & ~BindingFlags.Static) | BindingFlags.IgnoreCase, filter, criteria);
int i_len = i_members.Length;
if (i_len == 1){
}
MemberInfo [] s_members = t.FindMembers (
- mt, bf & ~BindingFlags.Instance, filter, criteria);
+ mt, (bf & ~BindingFlags.Instance) | BindingFlags.IgnoreCase, filter, criteria);
int s_len = s_members.Length;
if (i_len > 0 || s_len > 0)
/// <summary>
/// This method is only called from within MemberLookup. It tries to use the member
- /// cache if possible and falls back to the normal FindMembers if not. The `used_cache'
+ /// cache if possible and falls back to the normal FindMembers if not. The 'used_cache'
/// flag tells the caller whether we used the cache or not. If we used the cache, then
/// our return value will already contain all inherited members and the caller don't need
/// to check base classes and interfaces anymore.
}
//
- // If this is a dynamic type, it's always in the `builder_to_declspace' hash table
+ // If this is a dynamic type, it's always in the 'builder_to_declspace' hash table
// and we can ask the DeclSpace for the MemberCache.
//
if (t is TypeBuilder) {
MemberList list;
Timer.StartTimer (TimerType.FindMembers);
- list = decl.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ list = decl.FindMembers (mt, bf | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
FilterWithClosure_delegate, name);
Timer.StopTimer (TimerType.FindMembers);
used_cache = false;
if (t == object_type || t == string_type || t == int32_type || t == uint32_type ||
t == int64_type || t == uint64_type || t == float_type || t == double_type ||
t == char_type || t == short_type || t == decimal_type || t == bool_type ||
- t == sbyte_type || t == byte_type || t == ushort_type || t == void_type)
+ t == sbyte_type || t == byte_type || t == ushort_type || t == void_type ||
+ t == date_type)
return true;
else
return false;
}
//
- // Checks whether `type' is a subclass or nested child of `parent'.
+ // Checks whether 'type' is a subclass or nested child of 'parent'.
//
public static bool IsSubclassOrNestedChildOf (Type type, Type parent)
{
}
//
- // Checks whether `type' is a nested child of `parent'.
+ // Checks whether 'type' is a nested child of 'parent'.
//
public static bool IsNestedChildOf (Type type, Type parent)
{
{
if (indexer_arguments.Contains (indexer))
return (Type []) indexer_arguments [indexer];
- else if (indexer is PropertyBuilder)
+ else {
// If we're a PropertyBuilder and not in the
- // `indexer_arguments' hash, then we're a property and
+ // 'indexer_arguments' hash, then we're a property and
// not an indexer.
- return NoTypes;
- else {
+
+ MethodInfo mi = indexer.GetSetMethod (true);
+ if (mi == null) {
+ mi = indexer.GetGetMethod (true);
+ if (mi == null)
+ return NoTypes;
+ }
+
+ ParameterInfo [] pi = mi.GetParameters ();
+ if (pi == null)
+ return NoTypes;
+
+ int c = pi.Length;
+ Type [] types = new Type [c];
+
+ for (int i = 0; i < c; i++)
+ types [i] = pi [i].ParameterType;
+
+ indexer_arguments.Add (indexer, types);
+ return types;
+ }
+ /*else
+ {
ParameterInfo [] pi = indexer.GetIndexParameters ();
// Property, not an indexer.
if (pi == null)
indexer_arguments.Add (indexer, types);
return types;
- }
+ }*/
}
// <remarks>
return (MethodInfo) de.Second;
} else
- return pi.GetSetMethod ();
+ return pi.GetSetMethod (true);
}
static public MethodInfo GetPropertySetter (PropertyInfo pi)
return (MethodInfo) de.First;
} else
- return pi.GetGetMethod ();
+ return pi.GetGetMethod (true);
}
/// <summary>
/// This expands in context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
/// be IA, IB, IC.
/// </remarks>
+
public static Type [] ExpandInterfaces (Type [] base_interfaces)
- {
- ArrayList new_ifaces = new ArrayList ();
+ {
+ ArrayList new_ifaces = new ArrayList();
+ ExpandAllInterfaces (base_interfaces, ref new_ifaces);
+ Type [] ret = new Type [new_ifaces.Count];
+ new_ifaces.CopyTo (ret, 0);
- foreach (Type iface in base_interfaces){
+ return ret;
+ }
+
+ /// <summary>
+ /// Recursively finds out each base interface in case
+ /// of multiple inheritance
+ /// </summary>
+ public static void ExpandAllInterfaces
+ (Type [] base_interfaces, ref ArrayList new_ifaces)
+ {
+ foreach (Type iface in base_interfaces) {
if (!new_ifaces.Contains (iface))
new_ifaces.Add (iface);
Type [] implementing = TypeManager.GetInterfaces (iface);
-
- foreach (Type imp in implementing){
- if (!new_ifaces.Contains (imp))
- new_ifaces.Add (imp);
- }
+ //
+ // Incase any base interface is present call this function again
+ //
+ if (implementing.Length != 0)
+ ExpandAllInterfaces (implementing, ref new_ifaces);
}
- Type [] ret = new Type [new_ifaces.Count];
- new_ifaces.CopyTo (ret, 0);
- return ret;
}
/// <summary>
- /// This function returns the interfaces in the type `t'. Works with
+ /// This function returns the interfaces in the type 't'. Works with
/// both types and TypeBuilders.
/// </summary>
public static Type [] GetInterfaces (Type t)
//
// FIXME OPTIMIZATION:
// as soon as we hit a non-TypeBuiler in the interface
- // chain, we could return, as the `Type.GetInterfaces'
+ // chain, we could return, as the 'Type.GetInterfaces'
// will return all the interfaces implement by the type
// or its parents.
//
NumberFormatInfo provider = ci.NumberFormat;
//
- // We must use Type.Equals() here since `conversionType' is
+ // We must use Type.Equals() here since 'conversionType' is
// the TypeBuilder created version of a system type and not
// the system type itself. You cannot use Type.GetTypeCode()
// on such a type - it'd always return TypeCode.Object.
return TypeManager.uint64_type;
case TypeCode.String:
return TypeManager.string_type;
+ case TypeCode.DateTime:
+ return TypeManager.date_type;
default:
if (t == typeof (void))
return TypeManager.void_type;
Report.Error (
208, loc,
"Cannot take the address or size of a variable of a managed type ('" +
- CSharpName (t) + "')");
+ MonoBASIC_Name (t) + "')");
return false;
}
/// Returns the name of the indexer in a given type.
/// </summary>
/// <remarks>
- /// The default is not always `Item'. The user can change this behaviour by
+ /// The default is not always 'Item'. The user can change this behaviour by
/// using the DefaultMemberAttribute in the class.
///
- /// For example, the String class indexer is named `Chars' not `Item'
+ /// For example, the String class indexer is named 'Chars' not 'Item'
/// </remarks>
public static string IndexerPropertyName (Type t)
{
if (t.IsInterface) {
Interface i = LookupInterface (t);
- if ((i == null) || (i.IndexerName == null))
+ if ((i == null) || (i.DefaultPropName == null))
return "Item";
- return i.IndexerName;
+ return i.DefaultPropName;
} else {
TypeContainer tc = LookupTypeContainer (t);
- if ((tc == null) || (tc.IndexerName == null))
+ if ((tc == null) || (tc.DefaultPropName == null))
return "Item";
- return tc.IndexerName;
+ return tc.DefaultPropName;
}
}
}
//
- // We copy methods from `new_members' into `target_list' if the signature
+ // We copy methods from 'new_members' into 'target_list' if the signature
// for the method from in the new list does not exist in the target_list
//
// The name is assumed to be the same.
if (a.TypeId == TypeManager.obsolete_attribute_type){
ObsoleteAttribute oa = (ObsoleteAttribute) a;
- string method_desc = TypeManager.CSharpSignature (mb);
+ string method_desc = TypeManager.MonoBASIC_Signature (mb);
if (oa.IsError) {
- Report.Error (619, loc, "Method `" + method_desc +
- "' is obsolete: `" + oa.Message + "'");
+ Report.Error (619, loc, "Method '" + method_desc +
+ "' is obsolete: '" + oa.Message + "'");
return MethodFlags.IsObsoleteError;
} else
- Report.Warning (618, loc, "Method `" + method_desc +
- "' is obsolete: `" + oa.Message + "'");
+ Report.Warning (618, loc, "Method '" + method_desc +
+ "' is obsolete: '" + oa.Message + "'");
flags |= MethodFlags.IsObsolete;
static internal bool FilterWithClosure (MemberInfo m, object filter_criteria)
{
//
- // Hack: we know that the filter criteria will always be in the `closure'
+ // Hack: we know that the filter criteria will always be in the 'closure'
// fields.
//
return true;
//
- // Ugly: we need to find out the type of `m', and depending
+ // Ugly: we need to find out the type of 'm', and depending
// on this, tell whether we accept or not
//
if (m is MethodBase){
static MemberFilter FilterWithClosure_delegate = new MemberFilter (FilterWithClosure);
//
- // Looks up a member called `name' in the `queried_type'. This lookup
- // is done by code that is contained in the definition for `invocation_type'.
+ // Looks up a member called 'name' in the 'queried_type'. This lookup
+ // is done by code that is contained in the definition for 'invocation_type'.
//
- // The binding flags are `bf' and the kind of members being looked up are `mt'
+ // The binding flags are 'bf' and the kind of members being looked up are 'mt'
//
// Returns an array of a single element for everything but Methods/Constructors
// that might return multiple matches.
ArrayList method_list = null;
Type current_type = queried_type;
+ if (queried_type == null)
+ throw new ArgumentNullException("queried_type");
bool searching = (original_bf & BindingFlags.DeclaredOnly) == 0;
bool private_ok;
bool always_ok_flag = false;
MemberList list;
//
- // `NonPublic' is lame, because it includes both protected and
+ // 'NonPublic' is lame, because it includes both protected and
// private methods, so we need to control this behavior by
// explicitly tracking if a private method is ok or not.
//
closure_queried_type = current_type;
Timer.StopTimer (TimerType.MemberLookup);
-
+ bf |= BindingFlags.IgnoreCase;
list = MemberLookup_FindMembers (current_type, mt, bf, name, out used_cache);
Timer.StartTimer (TimerType.MemberLookup);
continue;
//
- // Events and types are returned by both `static' and `instance'
+ // Events and types are returned by both 'static' and 'instance'
// searches, which means that our above FindMembers will
// return two copies of the same.
//
if (mt == MemberTypes.Event)
return new MemberList (type.GetEvents (bf | BindingFlags.DeclaredOnly));
else
- return new MemberList (type.FindMembers (mt, bf | BindingFlags.DeclaredOnly,
+ return new MemberList (type.FindMembers (mt, bf | BindingFlags.DeclaredOnly | BindingFlags.IgnoreCase,
null, null));
}