mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-18 08:06:04 +02:00
Comptime method reflection fixes
This commit is contained in:
parent
db839035c0
commit
9de99cd422
2 changed files with 23 additions and 3 deletions
|
@ -29,8 +29,8 @@ namespace System.Reflection
|
|||
get
|
||||
{
|
||||
if (Compiler.IsComptime)
|
||||
Type.[Friend]Comptime_Method_GetName(mNativeMethodInstance);
|
||||
return "";
|
||||
return Type.[Friend]Comptime_Method_GetName(mNativeMethodInstance);
|
||||
return "?";
|
||||
}
|
||||
}
|
||||
public int ParamCount
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace System
|
|||
if (matched.[Friend]mMethodData != null)
|
||||
return .Err(.MultipleResults);
|
||||
else
|
||||
matched = methodInfo;
|
||||
matched = methodInfo;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -41,6 +41,26 @@ namespace System
|
|||
return .Ok(matched);
|
||||
}
|
||||
|
||||
[Comptime]
|
||||
public virtual Result<ComptimeMethodInfo, MethodError> GetMethod(StringView methodName, BindingFlags bindingFlags = cDefaultLookup)
|
||||
{
|
||||
ComptimeMethodInfo matched = default;
|
||||
for (let methodInfo in ComptimeMethodInfo.Enumerator(this as TypeInstance, bindingFlags))
|
||||
{
|
||||
if (methodInfo.Name == methodName)
|
||||
{
|
||||
if (matched.mNativeMethodInstance != 0)
|
||||
return .Err(.MultipleResults);
|
||||
else
|
||||
matched = methodInfo;
|
||||
}
|
||||
}
|
||||
|
||||
if (matched.mNativeMethodInstance == 0)
|
||||
return .Err(.NoResults);
|
||||
return .Ok(matched);
|
||||
}
|
||||
|
||||
public virtual Result<MethodInfo, MethodError> GetMethod(int methodIdx)
|
||||
{
|
||||
return .Err(.NoResults);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue