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

Reflection support for methods and types

This commit is contained in:
Brian Fiete 2020-05-28 07:36:34 -07:00
parent f1eafa8d81
commit be6a132fb5
4 changed files with 61 additions and 19 deletions

View file

@ -54,6 +54,12 @@ namespace System.Reflection
}
}
public this(TypeInstance typeInstance, TypeInstance.MethodData* methodData)
{
mTypeInstance = typeInstance;
mMethodData = methodData;
}
public Type GetParamType(int paramIdx)
{
Debug.Assert((uint)paramIdx < (uint)mMethodData.mParamCount);
@ -66,10 +72,9 @@ namespace System.Reflection
return mMethodData.mParamData[paramIdx].mName;
}
public this(TypeInstance typeInstance, TypeInstance.MethodData* methodData)
public Result<T> GetCustomAttribute<T>() where T : Attribute
{
mTypeInstance = typeInstance;
mMethodData = methodData;
return mTypeInstance.[Friend]GetCustomAttribute<T>(mMethodData.mCustomAttributesIdx);
}
public enum CallError