mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 07:44:09 +02:00
Enumerate through base types, respect .DeclaredOnly
This commit is contained in:
parent
076be19488
commit
38c5bd747e
2 changed files with 26 additions and 49 deletions
|
@ -18,6 +18,7 @@ namespace System.Reflection
|
|||
mMethodData = methodData;
|
||||
}
|
||||
|
||||
public TypeInstance DeclaringType => mTypeInstance;
|
||||
public bool IsInitialized => mMethodData != null;
|
||||
public StringView Name => mMethodData.[Friend]mName;
|
||||
public int ParamCount => mMethodData.[Friend]mParamCount;
|
||||
|
@ -788,7 +789,15 @@ namespace System.Reflection
|
|||
{
|
||||
mIdx++;
|
||||
if (mIdx == mTypeInstance.[Friend]mMethodDataCount)
|
||||
return false;
|
||||
{
|
||||
if (mBindingFlags.HasFlag(.DeclaredOnly))
|
||||
return false;
|
||||
if (mTypeInstance.[Friend]mBaseType == 0)
|
||||
return false;
|
||||
mTypeInstance = Type.[Friend]GetType(mTypeInstance.[Friend]mBaseType) as TypeInstance;
|
||||
mIdx = -1;
|
||||
continue;
|
||||
}
|
||||
var methodData = &mTypeInstance.[Friend]mMethodDataPtr[mIdx];
|
||||
bool matches = (mBindingFlags.HasFlag(BindingFlags.Static) && (methodData.mFlags.HasFlag(.Static)));
|
||||
matches |= (mBindingFlags.HasFlag(BindingFlags.Instance) && (!methodData.mFlags.HasFlag(.Static)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue