mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-17 15:46:05 +02:00
Added GetGenericArgType to MethodInfo
This commit is contained in:
parent
7e59c7fb93
commit
6a8bbd1240
4 changed files with 54 additions and 5 deletions
|
@ -55,6 +55,9 @@ namespace System.Reflection
|
|||
public int ParamCount => Compiler.IsComptime ?
|
||||
Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mParamCount :
|
||||
mData.mMethodData.[Friend]mParamCount;
|
||||
public int GenericArgCount => Compiler.IsComptime ?
|
||||
Type.[Friend]Comptime_Method_GetInfo(mData.mComptimeMethodInstance).mGenericArgCount :
|
||||
0;
|
||||
|
||||
public bool IsConstructor => Compiler.IsComptime ?
|
||||
(Name == "__BfCtor" || Name == "__BfStaticCtor") :
|
||||
|
@ -81,6 +84,18 @@ namespace System.Reflection
|
|||
}
|
||||
}
|
||||
|
||||
public Type GetGenericArgType(int genericArgIdx)
|
||||
{
|
||||
if (Compiler.IsComptime)
|
||||
{
|
||||
return Type.[Friend]Comptime_Method_GetGenericArg(mData.mComptimeMethodInstance, (.)genericArgIdx);
|
||||
}
|
||||
else
|
||||
{
|
||||
Runtime.FatalError();
|
||||
}
|
||||
}
|
||||
|
||||
public StringView GetParamName(int paramIdx)
|
||||
{
|
||||
if (Compiler.IsComptime)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue