1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-17 07:44:09 +02:00

Reflection support for method param attributes, return attributes

This commit is contained in:
Brian Fiete 2021-07-06 10:55:38 -07:00
parent 19513d3310
commit c10565678e
4 changed files with 38 additions and 14 deletions

View file

@ -37,11 +37,22 @@ namespace System.Reflection
return mMethodData.mParamData[paramIdx].mName;
}
public Result<T> GetParamCustomAttribute<T>(int paramIdx) where T : Attribute
{
Debug.Assert((uint)paramIdx < (uint)mMethodData.mParamCount);
return mTypeInstance.[Friend]GetCustomAttribute<T>(mMethodData.mParamData[paramIdx].mCustomAttributesIdx);
}
public Result<T> GetCustomAttribute<T>() where T : Attribute
{
return mTypeInstance.[Friend]GetCustomAttribute<T>(mMethodData.mCustomAttributesIdx);
}
public Result<T> GetReturnCustomAttribute<T>() where T : Attribute
{
return mTypeInstance.[Friend]GetCustomAttribute<T>(mMethodData.mReturnCustomAttributesIdx);
}
public enum CallError
{
case None;