1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Implemented mAllowReadOnlyReference for expression-bodied methods

This commit is contained in:
Brian Fiete 2022-05-13 14:25:10 -07:00
parent 5bd8aac41b
commit 688c80e2fc

View file

@ -21239,8 +21239,12 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
expectingType = NULL;
}
BfExprEvaluator exprEvaluator(this);
if (mCurMethodInstance->mMethodDef->mIsReadOnly)
exprEvaluator.mAllowReadOnlyReference = true;
UpdateSrcPos(expressionBody);
auto retVal = CreateValueFromExpression(expressionBody, expectingType, exprEvalFlags);
auto retVal = CreateValueFromExpression(exprEvaluator, expressionBody, expectingType, exprEvalFlags);
if ((retVal) && (!retVal.mType->IsVar()) && (expectingType != NULL))
{
mCurMethodState->mHadReturn = true;