mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed reflecting Invoke for delegate/function
This commit is contained in:
parent
9d72043a71
commit
b98f1ea6a4
3 changed files with 8 additions and 0 deletions
|
@ -7299,6 +7299,9 @@ BfIRValue BfModule::CreateTypeData(BfType* type, Dictionary<int, int>& usedStrin
|
|||
|
||||
bool includeMethod = reflectIncludeAllMethods;
|
||||
|
||||
if (typeInstance->IsDelegateOrFunction())
|
||||
includeMethod = true;
|
||||
|
||||
BfMethodCustomAttributes* methodCustomAttributes = NULL;
|
||||
if ((defaultMethod->mMethodInfoEx != NULL) && (defaultMethod->mMethodInfoEx->mMethodCustomAttributes != NULL) && (defaultMethod->mMethodInfoEx->mMethodCustomAttributes->mCustomAttributes != NULL))
|
||||
{
|
||||
|
|
|
@ -4675,6 +4675,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
|||
typeInstance->mInstSize = std::max(0, typeInstance->mInstSize);
|
||||
typeInstance->mInstAlign = std::max(0, typeInstance->mInstAlign);
|
||||
|
||||
if (typeInstance->IsDelegateOrFunction())
|
||||
typeInstance->mAlwaysIncludeFlags = (BfAlwaysIncludeFlags)(typeInstance->mAlwaysIncludeFlags | BfAlwaysIncludeFlag_IncludeAllMethods);
|
||||
|
||||
ProcessCustomAttributeData();
|
||||
int packing = 0;
|
||||
bool isUnion = false;
|
||||
|
|
|
@ -690,6 +690,8 @@ bool BfMethodDef::CanReflect()
|
|||
return true;
|
||||
if (mMethodType == BfMethodType_Ctor)
|
||||
return true;
|
||||
if ((mDeclaringType->mIsDelegate) || (mDeclaringType->mIsFunction))
|
||||
return mName == "Invoke";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue