1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed ref returns in delegate/function type references

This commit is contained in:
Brian Fiete 2021-01-20 13:42:31 -08:00
parent b1432782a8
commit 77c3eebbae
3 changed files with 3 additions and 4 deletions

View file

@ -20376,7 +20376,7 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth
BfType* expectType = NULL; BfType* expectType = NULL;
if (!methodInstance->mReturnType->IsVoid()) if (!methodInstance->mReturnType->IsVoid())
expectType = methodInstance->mReturnType; expectType = methodInstance->mReturnType;
CreateValueFromExpression(bodyExpr, expectType); CreateValueFromExpression(bodyExpr, expectType, BfEvalExprFlags_AllowRefExpr);
} }
}; };

View file

@ -9978,7 +9978,7 @@ BfType* BfModule::ResolveTypeRef(BfTypeReference* typeRef, BfPopulateType popula
bool failed = false; bool failed = false;
auto returnType = ResolveTypeRef(delegateTypeRef->mReturnType, NULL, BfPopulateType_Declaration); auto returnType = ResolveTypeRef(delegateTypeRef->mReturnType, NULL, BfPopulateType_Declaration, BfResolveTypeRefFlag_AllowRef);
if (returnType == NULL) if (returnType == NULL)
{ {
failed = true; failed = true;

View file

@ -3381,11 +3381,10 @@ int BfResolvedTypeSet::Hash(BfTypeReference* typeRef, LookupContext* ctx, BfHash
{ {
int hashVal = HASH_DELEGATE; int hashVal = HASH_DELEGATE;
if (delegateTypeRef->mReturnType != NULL) if (delegateTypeRef->mReturnType != NULL)
hashVal = ((hashVal ^ (Hash(delegateTypeRef->mReturnType, ctx))) << 5) - hashVal; hashVal = ((hashVal ^ (Hash(delegateTypeRef->mReturnType, ctx, BfHashFlag_AllowRef))) << 5) - hashVal;
else else
ctx->mFailed = true; ctx->mFailed = true;
bool isFirstParam = true; bool isFirstParam = true;
for (auto param : delegateTypeRef->mParams) for (auto param : delegateTypeRef->mParams)