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

Allow calling convention attributes

This commit is contained in:
Brian Fiete 2021-12-27 12:55:14 -05:00
parent 096ade7614
commit b9908cb4a8
11 changed files with 240 additions and 93 deletions

View file

@ -3670,6 +3670,8 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfType* rhs, LookupContext* ctx)
BfDelegateInfo* rhsDelegateInfo = rhs->GetDelegateInfo();
if (lhsInst->mTypeDef->mIsDelegate != rhsInst->mTypeDef->mIsDelegate)
return false;
if (lhsDelegateInfo->mCallingConvention != rhsDelegateInfo->mCallingConvention)
return false;
auto lhsMethodDef = lhsInst->mTypeDef->mMethods[0];
auto rhsMethodDef = rhsInst->mTypeDef->mMethods[0];
@ -4091,8 +4093,16 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, LookupContext*
if ((lhs->IsDelegate()) != rhsIsDelegate)
return false;
BfCallingConvention rhsCallingConvention = BfCallingConvention_Unspecified;
if (ctx->mRootTypeRef == rhsDelegateType)
rhsCallingConvention = ctx->mCallingConvention;
else
ctx->mModule->GetDelegateTypeRefAttributes(rhsDelegateType, rhsCallingConvention);
if (lhsDelegateInfo->mCallingConvention != rhsCallingConvention)
return false;
if (!Equals(lhsDelegateInfo->mReturnType, rhsDelegateType->mReturnType, ctx))
return false;
return false;
bool isMutating = true;