{
internal static class SymbolTable
{
+ private const BindingFlags EverythingBindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static;
private static readonly HashSet<Type> s_typesWithConversionsLoaded = new HashSet<Type>();
private static readonly HashSet<NameHashKey> s_namesLoadedForEachType = new HashSet<NameHashKey>();
// Now loop over all methods and add them.
IEnumerator<MemberInfo> memberEn = type
- .GetMembers(
- BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static)
+ .GetMembers(EverythingBindingFlags)
.Where(member => member.DeclaringType == type && member.Name == name).GetEnumerator();
if (memberEn.MoveNext())
{
{
MethodBase methodBase = t.DeclaringMethod;
bool bAdded = false;
- foreach (MethodInfo methinfo in Enumerable.Where(t.DeclaringType.GetRuntimeMethods(), m => m.HasSameMetadataDefinitionAs(methodBase)))
+ foreach (MethodInfo methinfo in t.DeclaringType.GetMethods(EverythingBindingFlags))
{
- if (!methinfo.IsGenericMethod)
+ if (!methinfo.HasSameMetadataDefinitionAs(methodBase) || !methinfo.IsGenericMethod)
{
continue;
}
AggregateType aggtype = type.getThisType();
Type t = aggtype.AssociatedSystemType;
- var props = Enumerable.Where(t.GetRuntimeProperties(), x => x.Name == property.Text);
-
- foreach (PropertyInfo pi in props)
+ foreach (PropertyInfo pi in t.GetProperties(EverythingBindingFlags))
{
- AddPropertyToSymbolTable(pi, type);
+ if (pi.Name == property.Text)
+ {
+ AddPropertyToSymbolTable(pi, type);
+ }
}
}
if (property.GetMethod != null || property.SetMethod != null)
{
MethodInfo accessor = property.GetMethod ?? property.SetMethod; // Must have at least one.
- prop.isOverride = accessor.IsVirtual && accessor.IsHideBySig && accessor.GetRuntimeBaseDefinition() != accessor;
+ prop.isOverride = accessor.IsVirtual && accessor.IsHideBySig && accessor.GetBaseDefinition() != accessor;
prop.isHideByName = !accessor.IsHideBySig;
}
}
else
{
- var methods = Enumerable.Where(t.GetRuntimeMethods(), m => m.Name == methodName.Text && m.DeclaringType == t);
-
- foreach (MethodInfo m in methods)
+ foreach (MethodInfo m in t.GetMethods(EverythingBindingFlags))
{
- AddMethodToSymbolTable(
- m,
- type,
- m.Name == SpecialNames.Invoke ? MethodKindEnum.Invoke : MethodKindEnum.Actual);
+ if (m.Name == methodName.Text && m.DeclaringType == t)
+ {
+ AddMethodToSymbolTable(
+ m,
+ type,
+ m.Name == SpecialNames.Invoke ? MethodKindEnum.Invoke : MethodKindEnum.Actual);
+ }
}
}
}
if (method != null)
{
methodSymbol.typeVars = GetMethodTypeParameters(method, methodSymbol);
- methodSymbol.isOverride = method.IsVirtual && method.IsHideBySig && method.GetRuntimeBaseDefinition() != method;
+ methodSymbol.isOverride = method.IsVirtual && method.IsHideBySig && method.GetBaseDefinition() != method;
methodSymbol.isOperator = IsOperator(method);
methodSymbol.swtSlot = GetSlotForOverride(method);
methodSymbol.RetType = GetCTypeFromType(method.ReturnType);
{
if (method.IsVirtual && method.IsHideBySig)
{
- MethodInfo baseMethodInfo = method.GetRuntimeBaseDefinition();
+ MethodInfo baseMethodInfo = method.GetBaseDefinition();
if (baseMethodInfo == method)
{
// We just found ourselves, so we don't care here.
AggregateSymbol aggregate = ((AggregateType)t).OwningAggregate;
// Now find all the conversions and make them.
- foreach (MethodInfo conversion in type.GetRuntimeMethods())
+ foreach (MethodInfo conversion in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
{
- if (conversion.IsPublic && conversion.IsStatic && conversion.DeclaringType == type
- && conversion.IsSpecialName && !conversion.IsGenericMethod)
+ if (conversion.DeclaringType == type && conversion.IsSpecialName && !conversion.IsGenericMethod)
{
MethodKindEnum methodKind;
switch (conversion.Name)