1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Improved ability of methodrefs to be used for Delegate constraints

This commit is contained in:
Brian Fiete 2022-06-13 06:52:12 -07:00
parent 7aa2fdf976
commit 46947636f7
3 changed files with 30 additions and 20 deletions

View file

@ -568,6 +568,12 @@ BfMethodCustomAttributes::~BfMethodCustomAttributes()
BfMethodInstance* BfMethodParam::GetDelegateParamInvoke()
{
if (mResolvedType->IsMethodRef())
{
auto methodRefType = (BfMethodRefType*)mResolvedType;
return methodRefType->mMethodRef;
}
BF_ASSERT(mResolvedType->IsDelegate() || mResolvedType->IsFunction());
auto bfModule = BfModule::GetModuleFor(mResolvedType);
BfMethodInstance* invokeMethodInstance = bfModule->GetRawMethodInstanceAtIdx(mResolvedType->ToTypeInstance(), 0, "Invoke");